_a = 1
Valid variables in Python
Float
To convert the read value through input() into a floating point number, _____ () is used.
sep
To give a different separator with print() _____ argument is used.
a b c = 1000 2000 3000
related to varaiables
What is wrong in the following variable?
Spaces are not allowed in variable names.
4.0 + float(3)
Give an example of type conversion?
s3 = s1.__add__(s2)
To concatenate two strings to a third
in
Which of the following cannot be a variable?
a) __init__
b) in
c) it
d) on
Float
special case of floating point numbers
What is the type of inf?
1abcdef
print("abcdef".center(7, '1'))
space
The default separator character of print() is _____.
-5
~x is equivalent to -(x+1).
What does ~4 evaluate to?
print(“hello\\example\\test.txt”)
statement prints hello\example\test.txt?
(a) #
(b) ’’’ ....’’’
the following can be used to create comments?
x = 03964
Which of the following is incorrect?
Numbers starting with a 0 are octal numbers but 9 isn’t allowed in octal numbers.
characters
Escape sequences are treated as _____.