Font size
WorksheetsPython Fundamentals-01
Total questions: 30
Worksheet time: 16mins
Why do we learn Python?
It's a really big snake
It's the name of a very funny comedy show
It's simple and easy to learn
It's so rare that no one else knows it
What is python programming language named after
Television show called Monty Python
The snake
Python was developed by
Guido Van Rossum
Gallileo
Edison
Thomas
What is the name of the environment in Python that you write your programs and then test them out?
Math
Window
IDLE
CLI
What will the output be from the following code?
print("Hello world!")
"Hello world!"
Hello world!
print(Hello world!)
SyntaxError
What is the name of the programming language we are learning?
Scratch
Pie thin
Pythan
Python
What symbol do you use to make a comment in Python?
%
@
#
*
Insert the missing part of the code below to output "Hello World".
____________("Hello World!")
raw_input
x=
string
What is the correct definition for a VARIABLE?
A named reserved memory location to store values
A comment in the program
print command in python
A text value in the program
Which data type represents a whole number?
Float
Boolean
Decimal
Integer
Data type that can only be true or false
int
string
boolean
float
Which operator is used to multiply numbers?
!
&
*
#
In Python, 'Hello', is the same as "Hello"
True
False
print("12"*3)
What would this print?
36
12*3
121212
24
What will the output be from the following code?
print(3+4)
3+4
7
SyntaxError
print(3+4)
Numbers with a decimal point belong to a type called
Integers
float
pointing
decimal
Create a variable named carname and assign the value Volvo to it.
carname = "Volvo"
carname = Volvo
Volvo="carname"
Volvo=carname
In the following code, "city" is an example of a what?
city = "New York"
List
Variable
Array
Number
What symbol is used in python to assign values to a variable?
equals =
plus +
forward slash /
asterisk *
To create a newline at the end of prompt, you can use which of the following expressions?
\new
\n
\break
\return
Create a variable named x and assign the value 50 to it.
x=50
x="50"
50=x
"50"=x
Create a variable called z, assign x + y to it.
x = 5
y = 10
_______
sum=x+y
z=x+y
x+y=sum
x+y=z
How do you create a variable with the floating number 2.8?
2.8 = x
x=2.8
2.8
x
Which of the following lines has error?
x=15
y=10
difference=x-y
print(diff)
4
3
2
1
Which of the following are not valid variables in Python?
1number
number1
numbe#r1
_number1
Which of the following is correct?
Variable name can start with a digit.
Variable name can start with an underscore or an alphbet.
Variable name can have symbols like: @, #, $ etc.
Variable name can have all numbers
What is used to take input from the user in Python?
cin
scanf()
input()
<>
Solve: 3 + 4 * 5
35
23
17
19
Solve: 5*4+4+20/5
24
28
35
40
Python Command to accept an integer value
input("Enter a number")
int(input("Enter a number"))
input(int("Enter a number"))
intinput("Enter a number")
