Font size
WorksheetsPython
Total questions: 53
Worksheet time: 27mins
print(3*4+5)
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly.
True
False
What will the output be from the following code?
print(3+4)
3+4
7
SyntaxError
print(3+4)
What would this print?
What will the output be from the following Python code?
Print("Hello world!")
NameError
Hello world!
"Hello world"
Print(Hello world!)
What will the output be from the following Python code?
print(9/3)
3
3.0
9/3
SyntaxError
print("Hello" + "world!")
print(9/3*2+4-5)
Which of the following are the fundamental building blocks of a python program?
identifiers
constants
punctuators
tokens
Identifier name cannot be composed of special characters other than _______________
underscore(_)
&
$
#
Python takes __________ indented spaces after the function declaration statement by default.
5
6
4
1
Single line comments in python begin with ___________ symbol.
#
"
'''
%
What is the order of precendence of arithmetic operators given below in python?
1. Paranthesis 2.Exponential 3.Multiplication 4. Division 5. Addition 6.Subtraction
1,2,3,4,5,6
2,3,4,5,6,1
1,3,2,6,4,5
4,6,5,2,3,1
What will be the output of the following code?
x,y=2,6
x,y=y,x+2
print(x,y)
6 6
4 4
4 6
6 4
The reserved words used in python interpreter to recognize the structure of a program is termed as __________
identifiers
tokens
literals
keywords
Which of the following operator is used for floor divivsion?
*
/
**
//
Which of the following is a valid statement?
a=b=c=20,60
a,b,c=10,20,30
a b c = 10 20 30
a_b_c=20
AN identifier must be a keyword of python
True
False
Integers and strings are immutable data types
True
False
3+a=c is a valid statement
True
False
The input() always returns a value of an integer type
True
False
The print() without any value or name or expression prints a blank line
True
False
"AISSCE- 2020" is a valid string variable in python
True
False
In python, integer data type has a fractional part
True
false
None literal in python means "there is nothing here"
True
False
Python supports multiple assignments to multiple variables
True
False
The correct way to convert user input is:
birth_year = number(input())
birth_year = int(input())
birth_year = (input(int))
birth_year = int(input)
You assign a value to a variable with which symbol
@
==
=
*
Python is case sensitive?
No
Yes
Both cases
None of them
Choose the INVALID identifiers from the following
NUmbEr1
1NUMBer
A_B
A&B
________ are data items that have a fixed value
Tokens
Literals
Keyword
Operators
Examples of String Literals
"ABC1273"
nfjdlsj@@$
12638
'7e920938'
Which of the following is a Boolean literal ?
True
false
False
true
Example of valid identifiers
12Name
name$
total-mark
total_marks
What is a String?
A data type that contains whole numbers. eg: 3, 45, 124
Numbers with decimal point. eg: 0.5, 2.45, 56.04
Group of characters between quotation marks. eg: "dog"
Data type that can only be True or False.
Which value is an Integer?
64
"cat"
True
0.5
What is a Float?
A data type that contains whole numbers. eg: 3, 45, 124
Numbers with decimal point. eg: 0.5, 2.45, 56.04
Group of characters between quotation marks. eg: "dog"
Data type that can only be True or False.
Which value is a Float?
64
"cat"
True
0.5
Debugging is
how characters are arranged in a statement
detecting or removing errors from a program
removing viruses from a computer
the meaning of each of the characters and symbols in the program
An exception is
the structure of form of the code
the meaning of the characters and words in the code
the statement that is missing from the instructions
an event occurring during execution of a program which disrupts the flow of the program's instructions
A block is
a statement including elements of a command
the structure and form of the code
source code that is grouped together
meaning assigned to symbols, characters and words
Output of ((5<10) and (5<2))
true
false
Error
None
Escape sequence is represented by a ____ followed by one or more characters
Front slash
Double Quote
Single Quote
Back Slash
Size of the string "Ant Man"
(a)
