ZyBook Flashcards
1
Q
What is a string literal?
A
text enclosed in quotes, either matching single or double quotes
2
Q
What command sends output to the screen?
A
3
Q
What syntax adds a newline to a print statement?
A
\n
Or
print()
4
Q
What does an empty print() statement do?
A
Makes a newline
5
Q
Assume variable age = 22, pet = “dog”, and pet_name = “Gerald”.
What is the output of
print(pet_name, ‘the’, pet, ‘is’, age)
A
Gerald the dog is 22
NOTE: no period at the end!!
6
Q
What command gets characters from a user through a keyboard?
A
input()
7
Q
What statement reads a user-entered string into variable num_cars?
A
num_cars = input()
8
Q
Complete a statement that reads a user-entered string into variable my_var.
A
my_var = input()