1. Which of these is the correct syntax when trying to compare variables?
A: if x = 5B: elif x = 5C: if x == 6D: if x is 6
2. What is the output of this statement given x = 6 and y = 4? print(x + y)
A: 10B: 6 + 4C: 9D: This will produce a syntax error
3. What is the proper way to use f string notation to output a string given these variables, name = "Super Easy" and software = "CRM"?
A: print(<name> is a cool <software>!)B: echo $name." is a great".$software C: print(f"{ name } is an awesome { software }"D: print"{ name } is an awesome { software }!"
4. How can you multiply items in a list? Example: product_costs = [6,5,6,8]
A: product_costs * product_costs[i]B: product_costs[0] * product_costs[2]C: for i in product_costs: i + 6D: product_costs:1 * product_costs:0
5. How can you double every item in a list? Example: days = [7,8,9]
A: for i in days: print(i *2)B: print(days * 2)C: print(days * days[1])D: print(days[(0 -2) * 2]
6. True or False: Python will throw an error if your code is not indented properly?
TrueFalse
7. Which of these is a proper Python variable?
A: b == 6B: type = "blue"C: $jump = 7D: int var = 7
8. How can you output a certain letter in a string? Example: mason = "Mason"
A: print(list(mason(3))B: print(mason[2])C: print(mason)D: print(mason[pos(1)])
9. Which statement returns "Super" if the length of the string is greater than 3 characters? Example: laptop = "Omen"
if strn_len > 5: print("Super")if strn_len(laptop) > 5: print("Super")if len(laptop) > 3: print("Super")if len(laptop) > 5: print("Super")
10. Python is older than JavaScript.
A: TrueB: False