NEW
Font size
WorksheetsPython Quiz-2
Total questions: 10
Worksheet time: 5mins
What is the syntax of if
if(conditions) then
statements
if(conditions):
statements
if conditions:
statements
if:(conditions)
statements
What is the syntax of if-else
if(conditions)
statements
else:
statements
if(conditions):
statements
else
statements
if(conditions):
statements
else:
statements
if(conditions)
statements
else
statements
What is the syntax of if-else ladder
if(conditions):
statements
elif(conditions):
statements
else:
statements
if(conditions):
statements
elif(conditions)
statements
else:
statements
if(conditions):
statements
elif(conditions):
statements
else
statements
if(conditions)
statements
elif(conditions):
statements
else:
statements
what is the syntax for --for loop
for var in range(startvalue,endvalue,value)
statements
for var in range(startvalue,value)
statements
for var in range(startvalue,endvalue,value):
statements
for i in range(endvalue,value)
statements
what is the syntax of while loop
initialization;
while(condition):
statements
itteration
initialization
while(condition)
statements
itteration
initialization;
while condition:
statements
itteration
initialization
while condition
statements
itteration
What is the use of format function
Int Converts float to other datatype
Int Converts string to other datatype
Int Converts int to other datatype
Int Converts other datatype string
What is the use of input function
It is used to assign a value to variable
It is used to input a value to variable
It is used to dis assign a value to variable
It is used to input a expression to variable
In python do-while can be possible
yes
no
What is the out put of the following program if you provide value -28
print("Enter Your Age")
age=input()
if (age>=1 and age<=100):
print("{0} is valid age".format(age))
else:
print("{0} is Invalid age".format(age))
-28 is valid Age
28 is valid Age
-28 is Invalid Age
28 is Invalid Age
What is the output of following program
for i in [1,2,3,4,5,6,7]:
if i==5:
pass
print i,
1 2 3 4 5 5 6 7
1 2 3 4 6 7
1 2 3 4
1 2 3 4 5 6 7
