WGU D335 Intro to Python
Comprehensive Practice Exam
180+ Questions with Answers in
Options
2025/2026 Update – OA & PA
Preparation
Question 1
What is the data type of `x = 5` in Python?
A) String
B) Integer
C) Float
D) Boolean
Correct Answer: B) Integer
Question 2
What will `print(3 + 2.5)` output?
A) 5
,B) 5.5
C) 6
D) Error
Correct Answer: B) 5.5
Question 3
Which symbol is used to denote a comment in Python?
A) //
B) /*
C) #
D) --
Correct Answer: C)
Question 4
What is the output of `print("Hello" + " " + "World")`?
A) HelloWorld
B) Hello World
C) "Hello World"
D) Error
Correct Answer: B) Hello World
**Question 5**
,What does the `input()` function return in Python?
A) An integer
B) A float
C) A string
D) A list
**Correct Answer: C) A string**
---
Question 6**
Which of the following is a valid variable name in Python?
A) 2variable
B) my-variable
C) my_variable
D) my variable
Correct Answer: C) my_variable
---
Question 7
What is the output of `print(type(3.14))`?
A) `<class 'int'>`
B) `<class 'float'>`
C) `<class 'str'>`
D) `<class 'bool'>`
, **Correct Answer: B) `<class 'float'>`**
---
Question 8
Which function converts a string to an integer?
A) str()
B) char()
C) int()
D) float()
Correct Answer: C) int()
---
Question 9
What will `print()` output?
A) 3
B) 3.3333333333333335
C) 3.33
D) Error
Correct Answer: B) 3.3333333333333335
Question 10
What is the result of `10 // 3` in Python?
Comprehensive Practice Exam
180+ Questions with Answers in
Options
2025/2026 Update – OA & PA
Preparation
Question 1
What is the data type of `x = 5` in Python?
A) String
B) Integer
C) Float
D) Boolean
Correct Answer: B) Integer
Question 2
What will `print(3 + 2.5)` output?
A) 5
,B) 5.5
C) 6
D) Error
Correct Answer: B) 5.5
Question 3
Which symbol is used to denote a comment in Python?
A) //
B) /*
C) #
D) --
Correct Answer: C)
Question 4
What is the output of `print("Hello" + " " + "World")`?
A) HelloWorld
B) Hello World
C) "Hello World"
D) Error
Correct Answer: B) Hello World
**Question 5**
,What does the `input()` function return in Python?
A) An integer
B) A float
C) A string
D) A list
**Correct Answer: C) A string**
---
Question 6**
Which of the following is a valid variable name in Python?
A) 2variable
B) my-variable
C) my_variable
D) my variable
Correct Answer: C) my_variable
---
Question 7
What is the output of `print(type(3.14))`?
A) `<class 'int'>`
B) `<class 'float'>`
C) `<class 'str'>`
D) `<class 'bool'>`
, **Correct Answer: B) `<class 'float'>`**
---
Question 8
Which function converts a string to an integer?
A) str()
B) char()
C) int()
D) float()
Correct Answer: C) int()
---
Question 9
What will `print()` output?
A) 3
B) 3.3333333333333335
C) 3.33
D) Error
Correct Answer: B) 3.3333333333333335
Question 10
What is the result of `10 // 3` in Python?