0% found this document useful (0 votes)
30 views1 page

Python Worksheet

Uploaded by

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

Python Worksheet

Uploaded by

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

Python Worksheet - DAY 1 Python Worksheet - DAY 1

Part A: Multiple Choice Questions (MCQs) Part A: Multiple Choice Questions (MCQs)
1. Python was developed by: 1. Python was developed by:
a) Charles Babbage b) Guido van Rossum a) Charles Babbage b) Guido van Rossum
c) Dennis Ritchie d) James Gosling c) Dennis Ritchie d) James Gosling
2. Which of the following is not a characteristic of Python? 2. Which of the following is not a characteristic of Python?
a) Easy to learn b) Platform dependent a) Easy to learn b) Platform dependent
c) Interpreted language d) Supports Object-Oriented Programming c) Interpreted language d) Supports Object-Oriented Programming
3. What is the correct way to write a single-line comment in Python? 3. What is the correct way to write a single-line comment in Python?
a) // comment b) /* comment */ a) // comment b) /* comment */
c) # comment d) <!-- comment --> c) # comment d) <!-- comment -->
4. Which escape sequence character is used to move to a new line in 4. Which escape sequence character is used to move to a new line in
Python? Python?
a) \t b) \n c) \r d) \b a) \t b) \n c) \r d) \b
5. What will be the output of this code? 5. What will be the output of this code?
print("Hello\nWorld") print("Hello\nWorld")
a) Hello World b) Hello a) Hello World b) Hello
World World
c) Hello\World d) Error c) Hello\World d) Error
6. Which of the following is the correct input statement in Python 3? 6. Which of the following is the correct input statement in Python 3?
a) read() b) get() a) read() b) get()
c) input() d) scan() c) input() d) scan()
7. In Python, indentation is mainly used for: 7. In Python, indentation is mainly used for:
a) Making code look beautiful b) Separating variables a) Making code look beautiful b) Separating variables
c) Defining code blocks d) Writing comments c) Defining code blocks d) Writing comments
Part B: True / False Part B: True / False
8. Python is a compiled language. 8. Python is a compiled language.
9. In Python, indentation is optional and does not affect the program. 9. In Python, indentation is optional and does not affect the program.
10. The escape sequence \t is used to insert a tab space in Python. 10. The escape sequence \t is used to insert a tab space in Python.
11. In Python, multi-line comments are written using triple quotes (''' 11. In Python, multi-line comments are written using triple quotes ('''
comment ''' or """ comment """). comment ''' or """ comment """).
12. The function print () is used to display output on the screen. 12. The function print () is used to display output on the screen.
13. input () function always takes input in string form. 13. input () function always takes input in string form.

You might also like