6th of October Technological University
[Link] Ali Shalaby
1. What will be the output of the following code?
var1 = "Hello“
var2 = "World"
var3 = "HelloWorld"
print(var1 + var2 == var3)
A. True
B. False
C. Syntax error
2. What will be the output of the following program?
x = "X"
y = "X"
print(x is y)
A. True (The is operator returns true if both the operands have
the same value. )
B. False
C. Syntax error
3. An expression 'str' in 'string' will return _________.
A. True
B. False
C. Syntax error
4. A list can contain _________ elements.
A. Unlimited (depends on computer's memory)
B. 10000
C. 1 Million
D. 10 Million
5. What will be the output of the following code?
nums = list({1 : 'one', 2 : 'two'})
print(nums)
A. A Syntax Error
B. [1, 2] convert dictionary to list taken key only
C. [‘one', ‘two']
6. How do you insert COMMENTS in Python code?
A. # This is comment
B. // This is comment//
C. /* This is comment*/
D. None
7. How to declare a variable in Python?
A. var name = " yasmeen"
B. string name = " yasmeen"
C. name = "yasmeen"
D. name: '''yasmeen'''
1. Python is object-oriented language. True
2. Python is a high level language. True
3. Python is a open source language. True
Best Wishes