stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
w1d1 - Python Basics Quiz Part II Flashcards | StudBud
Explore
/
w1d1 - Python Basics Quiz Part II
w1d1 - Python Basics Quiz Part II
8 terms
·
StudBud Administration
Test your knowledge on fundamental concepts of Python programming language with this engaging quiz
Flashcards
8 cards
F
Practice quiz
P
Host live
L
Questions
8
Answers
1
What symbol is used to write a comment in Python?
--
/* */
//
#
2
Which of the following will print on two lines?
print('line1\tline2')
print('line1\nline2')
print('line1,line2')
print('line1 line2')
3
What happens if you forget the closing quote in a string?
The print statement still works
The program runs but ignores the line
Python guesses the correct quote
The program will crash with a SyntaxError
4
What is the output of: print('Hello' + ' World')?
Hello World
Hello + World
SyntaxError
HelloWorld
5
What is the purpose of the input() function?
To ask for user input
To store values in memory
To print data to the screen
To comment code
6
Which of these is an invalid variable name?
band2
2cool4school
my_favorite_band
_band123
7
What does this code do? user_color = input('Fav color? ')
Stores a number into user_color
Prints user_color
Creates a comment
Asks for input and stores it in user_color
8
Which of the following correctly creates a variable and assigns a string?
band: 'Weezer'
band == 'Weezer'
band -> 'Weezer'
band = 'Weezer'