Python Exam UAH Latest Update 2024-2025
Actual Exam from Credible Sources with 250
Questions and Verified Correct Answers Golden
Ticket to Guaranteed A+ Verified by Professor
___represents an entity in the real world with its identity and behavior. - CORRECT
ANSWER:
(range(6)) - CORRECT ANSWER: (1,2,3,4,5,6)
A group of consecutive statements with the same indentation is called a _________ . -
CORRECT ANSWER: block
def value(a,b): return a[:b]. What is: print(value("Notebook",5)? - CORRECT ANSWER:
For x = (2+2)-(3*9)*(1-1)/12 - CORRECT ANSWER: 4
How are empty strings assigned in Python? - CORRECT ANSWER: "" var, str
How are the items in a dictionary deleted? - CORRECT ANSWER: del
dictionary_name[key]
How do you check the type of variable ? - CORRECT ANSWER:
How do you do an exponent in Python? - CORRECT ANSWER: x**n
How do you end an infinite loop on windows? - CORRECT ANSWER:
How do you output a blank line - CORRECT ANSWER: print()
,How do you print the second item in the list variable 'example'? - CORRECT ANSWER:
print (item 1)
How do you replace all "a" in a string "example" with "b"? - CORRECT ANSWER:
How does python do trig? - CORRECT ANSWER:
How does range(1,6) evaluate in Python? - CORRECT ANSWER: 1,2,3,4,5
How does range(2,10,2) evaluate in Python? - CORRECT ANSWER: 2,4,6,8,10
How does range(5, 0,-1) evaluate in Python? - CORRECT ANSWER: 5,4,3,2,1
How does range(5) evaluate in Python? - CORRECT ANSWER: 0,1,2,3,4,5
How is a dictionary defined? - CORRECT ANSWER: dict.
How many arguments can be passed to a function in a single function call? - CORRECT
ANSWER: zero or more
How to add x and y if x is an integer type, and y is a string ? - CORRECT ANSWER:
How would you add an alternate condition to an if statement? - CORRECT ANSWER:
else
How would you call the square root from the math module? - CORRECT ANSWER:
import math.sqrt
How would you cast the variable a that is equal to "2" to an integer 2? - CORRECT
ANSWER:
, If my_variable = "food", what is the data type of my_variable? - CORRECT ANSWER:
In Python, the operator != does what ? - CORRECT ANSWER: inequality
In Python, what data type do comparisons generate? - CORRECT ANSWER:
In Python, what is one function to output content to the display? - CORRECT ANSWER:
In Python, what is used to structure code? - CORRECT ANSWER:
In Python,the expression 4+3^2-6/3 will output - CORRECT ANSWER: syntax error (but
if 3**2 = 11)
inventory =["staff","hat","robe","bread"]. What is inventory.index("hat")? - CORRECT
ANSWER: 1
list movies= [["The Holy Grail",1975],["Sting", 1973]]. What is movies[1][0]? - CORRECT
ANSWER: sting
Math module is imported as m. What is: m.ceil(2.0083) ? - CORRECT ANSWER: 3
Math module is imported as m. What is: m.ceil(2.0083*10)/10? - CORRECT ANSWER:
2.1
Math module is imported as m. What is: m.ceil(2.0083*100)/100? - CORRECT
ANSWER: 2.01
num = set([1,1,2,3,3,3,4]) - CORRECT ANSWER:
Actual Exam from Credible Sources with 250
Questions and Verified Correct Answers Golden
Ticket to Guaranteed A+ Verified by Professor
___represents an entity in the real world with its identity and behavior. - CORRECT
ANSWER:
(range(6)) - CORRECT ANSWER: (1,2,3,4,5,6)
A group of consecutive statements with the same indentation is called a _________ . -
CORRECT ANSWER: block
def value(a,b): return a[:b]. What is: print(value("Notebook",5)? - CORRECT ANSWER:
For x = (2+2)-(3*9)*(1-1)/12 - CORRECT ANSWER: 4
How are empty strings assigned in Python? - CORRECT ANSWER: "" var, str
How are the items in a dictionary deleted? - CORRECT ANSWER: del
dictionary_name[key]
How do you check the type of variable ? - CORRECT ANSWER:
How do you do an exponent in Python? - CORRECT ANSWER: x**n
How do you end an infinite loop on windows? - CORRECT ANSWER:
How do you output a blank line - CORRECT ANSWER: print()
,How do you print the second item in the list variable 'example'? - CORRECT ANSWER:
print (item 1)
How do you replace all "a" in a string "example" with "b"? - CORRECT ANSWER:
How does python do trig? - CORRECT ANSWER:
How does range(1,6) evaluate in Python? - CORRECT ANSWER: 1,2,3,4,5
How does range(2,10,2) evaluate in Python? - CORRECT ANSWER: 2,4,6,8,10
How does range(5, 0,-1) evaluate in Python? - CORRECT ANSWER: 5,4,3,2,1
How does range(5) evaluate in Python? - CORRECT ANSWER: 0,1,2,3,4,5
How is a dictionary defined? - CORRECT ANSWER: dict.
How many arguments can be passed to a function in a single function call? - CORRECT
ANSWER: zero or more
How to add x and y if x is an integer type, and y is a string ? - CORRECT ANSWER:
How would you add an alternate condition to an if statement? - CORRECT ANSWER:
else
How would you call the square root from the math module? - CORRECT ANSWER:
import math.sqrt
How would you cast the variable a that is equal to "2" to an integer 2? - CORRECT
ANSWER:
, If my_variable = "food", what is the data type of my_variable? - CORRECT ANSWER:
In Python, the operator != does what ? - CORRECT ANSWER: inequality
In Python, what data type do comparisons generate? - CORRECT ANSWER:
In Python, what is one function to output content to the display? - CORRECT ANSWER:
In Python, what is used to structure code? - CORRECT ANSWER:
In Python,the expression 4+3^2-6/3 will output - CORRECT ANSWER: syntax error (but
if 3**2 = 11)
inventory =["staff","hat","robe","bread"]. What is inventory.index("hat")? - CORRECT
ANSWER: 1
list movies= [["The Holy Grail",1975],["Sting", 1973]]. What is movies[1][0]? - CORRECT
ANSWER: sting
Math module is imported as m. What is: m.ceil(2.0083) ? - CORRECT ANSWER: 3
Math module is imported as m. What is: m.ceil(2.0083*10)/10? - CORRECT ANSWER:
2.1
Math module is imported as m. What is: m.ceil(2.0083*100)/100? - CORRECT
ANSWER: 2.01
num = set([1,1,2,3,3,3,4]) - CORRECT ANSWER: