Variables
Data types
Strings
100

 _a = 1

Valid variables in Python

100

Float

To convert the read value through input() into a floating point number, _____ () is used.

100

sep

To give a different separator with print() _____ argument is used.

200

a b c = 1000 2000 3000

 related to varaiables

What is wrong in the following variable?

Spaces are not allowed in variable names.

200

4.0 + float(3)

Give an  example of type conversion? 

200

s3 = s1.__add__(s2)

To concatenate two strings to a third

300

 in

Which of the following cannot be a variable?
a) __init__
b) in
c) it
d) on

300

Float

special case of floating point numbers

What is the type of inf?  

300

1abcdef

print("abcdef".center(7, '1'))

400

space

The default separator character of print() is _____.

400

-5 

~x is equivalent to -(x+1).

What does ~4 evaluate to?

400

print(“hello\\example\\test.txt”)

statement prints hello\example\test.txt?

500

(a) #

(b) ’’’ ....’’’

the following can be used to create comments?

500

x = 03964

Which of the following is incorrect? 

Numbers starting with a 0 are octal numbers but 9 isn’t allowed in octal numbers.

500

characters

Escape sequences are treated as _____.

M
e
n
u