WorksheetsClass X-AI Class Test (Python Basics)
Total questions: 25
Worksheet time: 14mins
Which of the following is used to define a block of code in Python language?
Indentation
Key
Brackets
All of the mentioned
Who developed Python Programming Language?
Wick van Rossum
Rasmus Lerdorf
Guido van Rossum
Niene Stom
Which are arithmetic operators?
+
-
>
<
Examples of String Literals
"ABC1273"
nfjdlsj@@$
12638
'7e920938'
Which of the method used for taking user input?
input()
enter()
user_input()
scanf()
What is the correct way to declare a string in python and assign it a value "Hello"
string newVar("Hello")
newVar = "Hello"
newVar= string"Hello"
How can we create a variable named yourVar and assign it a value of 45 in Python
int yourVar =45
yourVar =45
None of the above
How did Python, the programming language get its name?
Which of the following is an example of a Python file extension?
py
pi
p
An operator able to check whether two values are NOT equal is coded as:
<>
!=
not ==
Which is the Python logo?
What is the word (command) used to display numbers and text on the screen?
input
output
command
Which of these isn't a Logical Operator?
and
or
not
True
The spelling and grammar rules of a programming language is called
GSP
syntax
code
comments
WHAT IS A TOKEN?
SMALLEST UNIT OF A PROGRAM
LITERALS
KEYWORDS, IDENTIFIERS
OPERATORS, PUNCTUATORS / DELIMETERS
ALL OF THE ABOVE
Is Python a case sensitive language?
No
Yes
print("3*4+5")
10=a
The above statement is valid in Python?
True
False
Which of the following rule of an identifiers (naming variable) is wrong?
First Character should either be an alphabet or an _
Special Characters can't be used
It is case sensitive ie, upper case and lower case are different
Reserved keywords can also be named as an identifiers.
is Python case sensitive when dealing with identifiers?
yes
no
machine dependent
none of these
Which operator is used to multiply numbers?
%
*
x
**
Which operator can be used to compare two values?
=
==
**
All of these.
Which operator is used to assign a value to a variable in Python?
==
<=
=
-=
Which operator is used for exponentiation in Python?
^
//
%
**
