Module 1 - Introduction to Python - Variables, Expressions, And Statements
Module 1 - Introduction to Python - Variables, Expressions, And Statements
x = y: y = 33
x = y = z = 33
x = z; y = z; x = 33;
x & y & z = 33
user
enter
input
value
Floating Decimal
Text String
Boolean Value
Integer
Output displayed by the print function will add this invisible character at the end
of the line by default ...
Multiple values specified in parentheses to print function will display each value
separated with this by default ...
Single Space
Double Space
A new Line
Double Lines
Which of the following will provide an ! character as alternative separator for the
print function?
sep is !
separate = !
sep = '!'
Which of the following will provide a * character as alternative line ending for
the print function?
end to *
end as *
end = '*'
ending = '*'
For which type of error does the interpreter halts and reports the error but does
not execute the program?
Semantic error
Syntax error
Runtime error
For which type of error does the interpreter runs the program but halts at error
and reports the error as an "Exception"?
Semantic error
Syntax error
Runtime error
For which type of error does the interpreter runs the program and does not report
an error?
Semantic error
Syntax error
Runtime error
>>> primt 'Hello world!' File "<stdin>", line 1 primt 'Hello world!'
SyntaxError: invalid syntax >>>
x = 3
y = 2
x += y
print(x)
x = 5
y = 7
x *= y
print(x)
x = 25
y = 15
x -= y
print(x)
x = 30
y = 7
x %= y
print(x)
x = 3
y = 7
print(x == y)
x = 83
y = 57
print(x > y)
x = True
y = False
print(x and y)
What will be the output after the following statements?
x = True
y = False
print(x or y)
x = True
y = False
print(not x)
x = True
y = False
print(not y)
x = 2 * 4 + 7
print(x)
x = 43
x = x + 1
print(x)
x = '24' + '16'
print(x)
What will be the data type of x after the following statement if input entered is
18 ?
What will be the data type of y after the following statements if input entered is
50?
Float
String
List
Integer
What will be the data type of y after the following statements?
x = 71
y = float(x)
Float
String
List
Integer
x, y, z = 3, 4, 5
x will have the value of 3, y will have the value 4 and z will have the value of 5
x and y will have arbitrary values, while z will have the value of 345
x = y = z = 8
print(y)
What is the name of the GUI that comes in-built as an interactive shell with
Python?
The keyboard