Study Guide Comprehensive Resource To Help You Ace
2026-2027 Exams Includes Frequently Tested Questions
With ELABORATED 100% Correct COMPLETE SOLUTIONS
Guaranteed Pass First Attempt!! Current Update!!
Instant Download Pdf
1. How do you write pi in Python?
Correct Answer: math.pi
2. How do you write e in Python?
Correct Answer: math.e
3. How do you gain access to a module’s functionality in Python?
Correct Answer: import it
Example: import math
4. If you do not use print(), what output will you normally see when running
code?
Correct Answer: the last output in the block
5. Which function is used to display output in Python?
Correct Answer: print()
6. Write an example of assigning a value to a variable.
Correct Answer: x = 6
7. Can an underscore (_) be used at the beginning of a variable name?
Correct Answer: yes
,8. Is _x a valid variable name in Python?
Correct Answer: yes
9. Can some names not be used as variables in Python?
Correct Answer: yes
10. Give an example of a name that should not be used as a variable.
Correct Answer: math
11. Which function is used to determine the type of a value?
Correct Answer: type()
12. What data type is the value 1?
Correct Answer: integer
int
13. What data type is the value 1.0?
Correct Answer: float
14. What data type is produced by 3 + 5.0?
Correct Answer: float
15. What is a value enclosed in quotation marks (' ') called?
Correct Answer: string
str
16. What is the Boolean data type called in Python?
Correct Answer: bool
17. What is the result of not False?
, Correct Answer: True
18. What is the result of not not False?
Correct Answer: False
19. Which function is used to find the length of a string?
Correct Answer: len()
20. How would you print the length of a string?
Correct Answer: print(len())
21. What can you use if a string contains quotation marks?
Correct Answer: ''' '''
22. Which keyword is used to check whether something exists inside
another value?
Correct Answer: in
23. What is the output of:
print('H' in 'Hello')
Correct Answer: True
24. What does format() do when used with curly brackets {} in a string?
Correct Answer: it replaces the curly brackets with whatever variable is
inside format()
25. What is the term used for replacing values inside a string with format()?
Correct Answer: string interpolation
26. What is the output of the following code?
name = 'deb'
, print('Hello {}'.format(name))
Correct Answer: Hello deb
27. What is the output of:
print('Hello' + ' ' + 'World')
Correct Answer: Hello World
28. What is the output of:
print('comma ' * 3 + 'chameleon')
Correct Answer:
comma comma comma chameleon
29. Which operator is used to test if two values are equal?
Correct Answer: ==
30. Which operator is used to test if two values are not equal?
Correct Answer: !=
31. What type of collection is created using square brackets [ ]?
Correct Answer: a list
32. How do you retrieve an item from a list?
Correct Answer:
print(highways[1])
33. What number do list indexes start at in Python?
Correct Answer: 0