Prework - Python Prework Final Exam Flashcards
True or False: The following statement creates a dictionary with elements:
d={40:”John”,45:”Peter”}
True
True or False: The following statement creates a dictionary with elements:
d={}
False
True or False: The following statement creates a dictionary with elements:
d={“John”:40,”Peter”:45}
True
True or False: The following statement creates a dictionary with elements:
d={40:”John”,45:”50”}
True
Suppose that list1 = {2,33,22,14,25}, what would the output for list1[0] be?
2
True or False: Boolean is a simple data type.
True
True or False: Floating Point Numbers are a simple data type.
True
True or False: A string is a simple data type.
True
True or False: An integer is a simple data type.
True
True or False: A dictionary is a compound data type.
True
True or False: An object is a compound data type.
False
True or False: A list is a compound data type.
True
True or False: A floating point number is a compound data type.
False
True or False: “While” is a keyword in Python?
True
True or False: “For” is a keyword in Python?
True
How many unique comparators are found in Python?
6 {== != >= <= >< }
What is a statement that control the flow of execution depending on some condition.
A conditional statement
What is a statement that iterates over the elements or members of a sequence in order?
A for loop
Whch 3 Python keywords comprise a conditional statement?
- If
- Elif
- Else
What will the output of this python code snippet be?
list = {“Hello” , “This” , “is” , “a” , “list”}
print(list{4})
list