0% found this document useful (0 votes)
2 views5 pages

Quiz 1 Model B python -Model Answer

The document contains a series of multiple-choice questions related to Python programming concepts, including code output predictions, data types, and syntax. It tests knowledge on string manipulation, list characteristics, comments, and variable declaration in Python. Additionally, it confirms the object-oriented nature and high-level status of Python as a programming language.

Uploaded by

malakmahamad376
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

Quiz 1 Model B python -Model Answer

The document contains a series of multiple-choice questions related to Python programming concepts, including code output predictions, data types, and syntax. It tests knowledge on string manipulation, list characteristics, comments, and variable declaration in Python. Additionally, it confirms the object-oriented nature and high-level status of Python as a programming language.

Uploaded by

malakmahamad376
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

6th of October Technological University

Dr.Yasmeen 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

You might also like