NEW
Font size
WorksheetsPython Basics Class 6
Total questions: 43
Worksheet time: 21mins
name = 'Dave'
print (name)
Which is the Python logo?
What is a input?
A function that allows us to ask the user to enter some data.
To plug in something.
Data displayed on a screen.
A function
What function is used to output a message in python?
print("")
input=name
name=input
x = 5
y = 6
print(x*y)
The code above displays the following:
11
x*y
Syntax Error
30
Operators used in python:
divide, multiply, add, subtract
/, *, +, -
div, mul, +, -
\, x, +, -
~, *, +, -
What is the answer to this expression, 22%3 is
7
1
0
5
Which is the correct operator for power xy
x^y
x**y
x^^y
None of these
Which one of theses is floor division
/
//
%
None of theses
What is the order of precedence in Python?
i. Parenthesis
ii. Exponential
iii. Multiplication
iv. Division
v. Addition
vi. Subtraction
i, ii, iii, iv, v, vi
ii, i, iii, iv, v, vi
ii, i, iv, iii, v, vi
i, ii, iii, vi, v, iv
Mathematical operations can be performed on a string
True
False
Operators with same precedence are evaluated in which manner?
Left to Right
Right to Left
Can't Say
None of the mentioned
What is the output of this expression, 3*1**3
27
9
3
1
Which of the following is true for variable names in python?
Unlimited Length
all private members must have leading and trailing underscores
underscores and ampersand are only two special characters allowed
None of these
Which of the following is an invalid variable?
my_string_1
1st_string
foo
-
is Python case sensitive when dealing with identifiers?
yes
no
machine dependent
none of these
name = 'Dave'
print (name)
Which is the Python logo?
What is a input?
A function that allows us to ask the user to enter some data.
To plug in something.
Data displayed on a screen.
A function
What is a output?
A piece of data that is shown on the screen.
Data that the user enters
An output
A orange
What function is used to output a message in python?
print("")
input=name
name=input
What syntax would you use to create a name variable?
name=input()
input=name
name=input{}
name=INPUT
What is pseudocode?
A planning tool that resembles code but is not code used for humans.
Syntax code
A programming language.
A pastry.
Why would you use a loop?
To repeat a piece of code
To create a loop
To input data
