google form Flashcards
(18 cards)
What is the output of this code?
for i in range(1, 8, 2):
print(i, end=” “)
1 3 5 7
What will be the output of: for i in range(3): print(i)?
012
What data type is used to represent whole numbers in Python?
int
Which statement will exit a loop prematurely?
break
How many bits are in a byte?
8
Which RGB value is white?
255 255 255
What component of a computer stores the BIOS?
ROM
What is the primary function of RAM in a computer?
temporary data storage
How can you convert a string to an integer in Python?
int(“string”)
What storage component provides temporary memory that clears when the computer shuts down?
RAM
In PEP 8, what is the recommended maximum line length?
79 characters
In Pygame, which method must be called to update the display?
pygame.display.update()
Which loop would be most appropriate for iterating through a list?
for
What does ‘self’ refer to in a Python class?
A reference to the current instance of the class
Which of the following is a valid float in Python?
3.0
What is the output of print(“Hello”[1:4])
ell
What is the purpose of a ‘for’ loop in Python?
To perform a task a specific number of times
Which of these follows PEP 8 naming conventions for variables?
first_name