Font size
WorksheetsPython if s
Total questions: 10
Worksheet time: 6mins
Python was invented by
Dennis Ritchie
Guido Van Rossum
Abel
Marro
the output of the following code is
# program for addition of 2 numbers
a = 10
b = 3
c = a + b
print("the sum is ", c)
7
10
13
3
output of the following question is:
#program for text addition
# input() method
f_name= "hello"
l_name ="world"
print( f_name + l_name)
helloworld
hello world
error
f_name+l_name
output of following code:
# \n in program
print("welcome\nto Python")
print("*********\n*********")
print("8th grade\nstudents\nare good")
error
welcome to Python 8th grade students are good
welcometoPython8thgradestudentsaregood
welcome
to Python
*********
*********
8th grade
students
are good
what will be printed for the value 8 for num
# program to check even or odd
num = (int)(input("enter any number"))
if num%2 == 0:
print("the number is even")
else :
print("the number is odd")
even
the number is even
the number is odd
None
range(5) gives the following list of values
1, 2, 3, 4, 5
1, 2, 3, 4
0, 1, 2, 3, 4
0, 1, 2, 3, 4, 5
what will be printed for:
for x in range (1, 7):
print(x)
7
1, 2, 3, 4, 5, 6, 7
1, 7
1, 2, 3, 4, 5, 6
Loop is an iterative structure.
(a) is an example of loops in Python
Python has how many keywords
12
32
33
45
Is python related to snakes?
yes
no
may be
