Day one - Variables Flashcards
1
Q
How to print several things line below line using the same ‘print’?
A
Using \n after the end of the message and beginning of where you want to separate. print('Hello\nHello\nHello') Hello Hello Hello
2
Q
How to write comments?
A
Use # before the text.
3
Q
Can you add many commands on the same line?
A
Yes.
print(‘Hello’ + input(‘Write your name: ‘)
4
Q
What can you do if you desire to write a code inside of a print function?
A
You have to use single and double comas.
print(“print(‘Data’)’)
5
Q
What to do if you want the answer of an input to be answered on the next line?
A
Use a \n at the end of it.
a = input(‘What is you name?\n’)