12 Answers
New AnswerIf you do print(" " hi" ") it will give you error. But you can do print(" 'hi' ") or print(' "hi" ')
" ": The string starts at " The string ends at the next " So if you do " " hi " " There are 2 empty strings and some unknown variable (hi) , causing error. The same thing with ' '
🌷 Alex Tusinean 🔥 and there is no operator between the Strings so that's an error source too
You can use the back-slash and this is known as 'escaping special characters' Secondly, enclose you text in a pair of three apostrophes. Do as if you are doing documentation (like docustring). I have included an example of this code. https://code.sololearn.com/cY4L3JdzwmzV/?ref=app
String Jika Anda ingin menggunakan teks dengan Python, Anda harus menggunakan string. String dibuat dengan memasukkan teks antara dua tanda kutip tunggal atau ganda. Ketika konsol Python menampilkan stri
You can't be use same quote inside same quote like outside Ex ..you write ("my name is "yuwandeval" i m from delhi") if you write this you got error beacase whenever you compile the program compiler thought first quote is ("my ) this one but close of this quote is "yuwan deval..but it is not its close points soo...you got order... Solition is that you use quote inside different quote so you never get error example ("My name is 'yuwan deval' and i m form ' delhi' yeap ") Output. My name is ' yuwan deval ' and i m from ' delhi' yeap.
Anuth Gowda1, a string is a set of characters placed in quotes. Perhaps read on data types for you to fully understand strings and what you can do or not do on them.