Font size
WorksheetsIntroduction to python programming-I
Total questions: 15
Worksheet time: 7mins
What is the word (command) used to display numbers and text on the screen?
Input
Output
Command
What symbol is used in python to assign values to a variable?
:
*
=
==
Which of these would work as a piece of code?
if string="Dove"
if string=="Dove"
IF string="Dove":
if string=="Dove":
Python is -------language
compiled
interpreted
both compiled and interpreted
none of the above
What extension must you add to the end of a file when saving?
.c
.java
.py
.pyc
The program above
prints all the odd numbers between 1 and 20
prints all even numbers between 1 and 20
print all the odd numbers between 1 and 21
prints all the even numbers between 1 and 21
The equivalent of the above for loop using the while syntax would be
The above program prints
Numbers 1 to 10 in reverse order
Numbers 1 to 11 in reverse order
Numbers 1 to 10
Numbers 1 to 11
The result of this program:
Friday = False
if Friday:
print("Jeans day!")
else:
print("Uniform day")
Jeans day
Today is Friday
Uniform day
Not Friday
What is the output?
condition
True
Program has a syntax error.
3 > 2
What is the output?
True
False
condition1
condition2
What is the output?
True
NIL
True
NIL
True
NIL
NIL
Result of the program above is
('1', '2', '3', '4', '5')
(1, 2, 3, 4, 5)
12345
"12345"
What is the output of the code:
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
print d1 > d2
True
False
Not applicable
