WGU D522: python for It Automation Exam 2026-2027 BANK
QUESTIONS WITH DETAILED VERIFIED ANSWERS EXAM
QUESTIONS WILL COME FROM HERE (100 % Latest Already
Graded A+
1. Which of the following best describes a variable in Python?
A) A reserved word that cannot be used as an identifier.
B) A named memory location that stores a value.
C) A function that performs a specific task.
D) A data type that holds only integers.
Answer: B) A named memory location that stores a value.
Explanation: In Python, a variable is a symbolic name that references an
object stored in memory. It is not a reserved word (that is a keyword),
nor a function, nor limited to integers. Variables can reference any data
type, and they are dynamically typed.
2. What is the output of print(type(3.14)) in Python?
A) <class 'int'>
,2|Page
B) <class 'float'>
C) <class 'str'>
D) <class 'tuple'>
Answer: B) <class 'float'>
Explanation: In Python, 3.14 is a floating-point number. The type()
function returns the data type of the object, so it returns <class 'float'>.
Integers do not contain a decimal point, and strings are enclosed in
quotes.
3. Which of the following is a valid Python identifier?
A) 2var
B) var-2
C) _var2
D) var 2
Answer: C) _var2
Explanation: Python identifiers must start with a letter (a-z, A-Z) or an
underscore (_), followed by letters, digits, or underscores. They cannot
start with a digit, contain spaces, or contain special characters like
hyphens.
4. What is the result of "Hello" + " " + "World"?
A) Hello World
B) HelloWorld
C) TypeError
,3|Page
D) Hello+World
Answer: A) Hello World
Explanation: The + operator concatenates strings in Python. Here,
"Hello" + " " yields "Hello ", and adding "World" results in "Hello World".
No error occurs because all operands are strings.
5. Which function is used to read input from the user in Python 3?
A) input()
B) raw_input()
C) read()
D) get_input()
Answer: A) input()
Explanation: In Python 3, input() reads a line from standard input and
returns it as a string. raw_input() was used in Python 2, and read() is for
file operations. get_input() is not a built-in function.
6. What does the len() function return when passed a string?
A) The number of words in the string.
B) The number of characters in the string.
C) The memory size of the string.
D) The number of vowels in the string.
Answer: B) The number of characters in the string.
, 4|Page
Explanation: len() returns the length of a sequence, such as a string, list,
or tuple. For a string, it counts every character, including spaces and
punctuation, not words or vowels.
7. Which operator is used for exponentiation in Python?
A) ^
B) **
C) *
D) //
Answer: B) **
Explanation: In Python, ** is the exponentiation operator. For example,
2 ** 3 returns 8. The ^ operator is used for bitwise XOR, * is
multiplication, and // is floor division.
8. What is the output of 5 // 2?
A) 2.5
B) 2
C) 3
D) 2.0
Answer: B) 2
Explanation: // is the floor division operator, which returns the integer
quotient, discarding any remainder. 5 // 2 equals 2, as it rounds down
to the nearest integer.