r before the string
Why print(r'\nHello\nWorld') its output would be \nHello\nWorld, where is the r in the beginning ? What does it mean?
For strings, there are several codes you can use to do a certain thing. '\n' means newline, so when you write ... print('Hello\nworld') ... it is printed in two lines. Having the r before the string (standing for 'raw') is an order to ignore all these codes and just print everything as it is. Basically it enters an extra '\' in front of each of these codes which will lead to them being ignored. You could also do that by hand, writing a bunch of '\' in front of all the codes.
Thank you, i understand now
Read Eve's answer in the thread below...he explained the concept very nicely https://www.sololearn.com/discuss/2696669/?ref=app
it will print: Hello 'whatevever the user inputs'!!!
Hey if u wanna get creative, use only f strings like this
name = input("What is your name: ")
Python — File Handling
Loop question, I've tried everything that I knew I just don't know. Please help me solve it out
Help me solve this (using loop)
What is wrong? Error on test.
Help me wiht python