Foundations Exam With Actual Questions
& Verified Answers,Plus
Rationales/Expert Verified For
Guaranteed Pass 2025/2026 /Latest
Update/Instant Download Pdf
1. Which of the following is a valid variable name in Python?
A) 1stVar
B) first_var
C) first-var
D) first var
B) first_var
Rationale: Variable names cannot start with a digit, cannot contain hyphens, and cannot
have spaces. first_var is valid.
2. What data type is returned by the expression in Python 3?
A) int
B) float
C) str
D) bool
B) float
Rationale: In Python 3, the division operator / always returns a float, even if both
operands are integers.
3. Which symbol is used for single-line comments in Python?
A) //
B) #
C) <!-- -->
D) /* */
B) #
Rationale: Python uses the # symbol for single-line comments.
, 4. Which Python statement is used to output text to the console?
A) write()
B) echo()
C) print()
D) output()
C) print()
Rationale: The print() function displays text or values to the console.
5. What is the correct way to create a list in Python?
A) myList = {}
B) myList = []
C) myList = ()
D) myList = <>
B) myList = []
Rationale: Lists in Python are created using square brackets [].
6. What will len("Hello World") return?
A) 10
B) 11
C) 12
D) 5
B) 11
Rationale: The len() function returns the number of characters including spaces.
7. Which of the following is a Python tuple?
A) (1, 2, 3)
B) [1, 2, 3]
C) {1, 2, 3}
D) <1, 2, 3>
A) (1, 2, 3)
Rationale: Tuples are immutable and defined with parentheses ().
8. How do you start a block of code in Python?
A) With a colon :
B) With curly braces {}
C) With parentheses ()
D) With a semicolon ;
A) With a colon :
Rationale: In Python, a colon indicates the start of a code block, such as after if, for, while,
or def statements.
, 9. Which keyword is used to define a function in Python?
A) func
B) define
C) def
D) function
C) def
Rationale: Python uses the def keyword to define a function.
10. What will 3 == 3.0 return in Python?
A) True
B) False
C) Error
D) None
A) True
Rationale: Python considers integer 3 and float 3.0 equal when using ==.
11. Which operator is used for exponentiation in Python?
A) ^
B) **
C) %
D) //
**B) **
Rationale: The ** operator performs exponentiation, e.g., 2 ** 3 equals 8.
12. How do you check if two values are not equal in Python?
A) !=
B) <>
C) !==
D) =!
A) !=
Rationale: != is the not equal operator in Python.
13. What is the result of bool("")?
A) True
B) False
C) None
D) Error
B) False
Rationale: Empty strings evaluate to False in a boolean context.