stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Python Flashcards | StudBud
Explore
/
Python
Python
30 terms
·
StudBud Administration
·
10 plays
Imported from external platform
Flashcards
30 cards
F
Practice quiz
P
Host live
L
Questions
30
Answers
1
6. You can not perform mathematical operations between an integer and a float.
True
False
2
23. What will this code print?
None
Divisible
Not Divisible
Error
3
25. What happens when you run this code?
None
Error
Yes
False
4
4. What is the data type of "45" (with quotation marks)?
Boolean
Integer
Float
String
5
16. The = operator is used to compare two values in Python
False
True
6
24. What is the correct way to check if x is NOT equal to 5?
x != 5
x <> 5
x =! 5
x not 5
7
27. What is the output of the following Python code?
Fail
Pass
Honors Pass
Honors
8
1. Strings in Python are surrounded by either single quotes ' or double quotes "?
False
True
9
15. The expression 4 > 2 and 5 < 10 evaluates to True
True
False
10
3. Which of the following is a valid variable name in Python?
if
number_2
my-variable
2number
11
10. Which of the following are valid arithmetic operators in Python?
** and %
All of the above
* and /
+ and -
12
5. What is the value of 'total' : total = (20 + 3 * 2) + 2
48
23
27
28
13
9. What will be the output of the following code?
2.5
7
25
10
14
7. What is the median of the following dataset [2, 2, 3, 7, 7, 10] ?
5
5.16
7
3
15
30. In Python you can have multiple elif statements in a single if block.
False
True
16
28. The following code is valid in Python.
True
False
17
2. What is the type of the following variable: quantity = 5.0?
Float
Boolean
Integer
String
18
17. What will this code output?
2
3
2.0
2.6
19
8. What will this code output?
None
7
Error
52
20
11. What is the result of this boolean expression?
Error
None
True
False
21
26. The if statement must always include an else clause.
False
True
22
13. What is the output of the following Python code?
Hello everyone! Welcome to DAB-PT10
Welcome to DAB-PT10
Error
“Hello everyone!”
23
12. In Python variable names can start with a number.
False
True
24
14. What does the following code print?
Even
Odd
None
Error
25
20. Which of the following are valid Python boolean expressions?
All of the above
a != b
) True and False
) x == 10
26
21. What is the output of the following Python code?
1040
50
Error
30
27
22. Which of the following is NOT a valid data type in Python?
string
float
boolean
decimal
28
29. What will be the output of the following code?
A, B
A
None
A, C
29
18. What is the value of result in the following code?
None
Error
False
True
30
19. What is wrong with the following python code?
Close the Quotation
Spelling Mistake
None
205 is an integer