Python Course

What is the value returned by the following script?
 
if 5 % 2 == 1:
      print('5 is odd.')
elif 6 % 2 == 0:
      print('6 is even.)
5 is odd.
6 is even.
5 is odd. 6 is even.
How do you write a for loop that goes through numbers 1 through 5?
for i in [1, 6]:
for i in range(1, 5):
for i in range(1, 6):
What are the values of the following expressions?

print('%.2f' %12.345)
print('%.1f' %12.345)
12 and 12
12.35 and 12.3
12.35 and 12
How do you assign the text "Alice" to a variable called first_name?
first_name = 'Alice'
first_name = "Alice"
first_name = 'Alice' or first_name = "Alice"
"first_name" = "Alice"
What is the value of the following expression?
 
"*" * 5
'*****'
*5
SyntaxError
*****
What is the value returned by the following script?
 
first_name = 'Alice'
print first_name
SyntaxError
Alice
None
'Alice'
mylist = [None, [1, 2], 'a', 1]

What is the value of mylist[1]?
[1, 2]
None
'a'
What is the value of the following expression?
 
half = 'half' '
1/2 is %d' %half
TypeError
1/2 is half
1/2 is 'half'
What is the value of the following expression?
 
half = 1/2
'1/2 is %s.' %half
'1/2 is 1.'
'1/2 is half'
TypeError
'1/2 is 0.5.'
What is the value returned by the following script?
 
type(1/2)
float
int
0
{"name":"Python Course", "url":"https://www.quiz-maker.com/QSUMBJID","txt":"What is the value returned by the following script?   if 5 % 2 == 1:       print('5 is odd.') elif 6 % 2 == 0:       print('6 is even.), How do you write a for loop that goes through numbers 1 through 5?, What are the values of the following expressions?print('%.2f' %12.345)print('%.1f' %12.345)","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker