0% found this document useful (0 votes)
3 views3 pages

Python Assignment

The document contains a series of multiple-choice questions related to Python programming, covering topics such as arithmetic operations, comments, user input, string methods, file extensions, and control flow. Each question presents four answer options, with one correct answer for each. The questions test fundamental knowledge of Python syntax and functions.
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)
3 views3 pages

Python Assignment

The document contains a series of multiple-choice questions related to Python programming, covering topics such as arithmetic operations, comments, user input, string methods, file extensions, and control flow. Each question presents four answer options, with one correct answer for each. The questions test fundamental knowledge of Python syntax and functions.
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

1. What is the output of 3 * 1 ** 3?

A) 27
B) 9
C) 3
D) 1

2. How do you start a comment in Python?

A) /*
B) //
C) #
D) <!--

3. Which function is used to take input from the user in Python?

A) scanf()
B) input()
C) cin
D) get()

4. What will len("Python") return?

A) 6
B) 5
C) 0
D) 7

5. What is the output of: print(2 ** 3)?

A) 6
B) 8
C) 9
D) 5

6. Which operator is used for floor division?

A) /
B) //
C) %
D) **

7. What is the output of print("abc".upper())?

A) abc
B) ABC
C) Abc
D) error
8. What will be the output of: print(10//3)?

A) 3.33
B) 3
C) 3.0
D) Error

9. Which of the following is the correct extension of Python files?

A) .pyth
B) .pt
C) .py
D) .p

[Link] will be the output of print(10 + 5.5)?

A) 15
B) 15.5
C) Error
D) 105.5

[Link] is the symbol used for exponentiation in Python?

A) ^
B) **
C) exp
D) ^^

[Link] of the following is used to get the remainder in Python?

A) /
B) //
C) **
D) %

[Link] will print(4 // 2) output?

A) 2.0
B) 2
C) 4
D) 0.5

[Link] of the following is a valid string in Python?

A) 'hello'
B) "hello"
C) '''hello'''
D) All of the above
[Link] keyword is used to exit a loop in Python?

A) exit
B) stop
C) end
D) break

You might also like