You are on page 1of 2

Quiz Report BASICS OF PYTHON

1. Strings are immutable in Python, which means that it cannot be modified.

Your Answer : True

2. x = ‘abcd’ For i in x Print (i.upper())

Your Answer : ABCD

3. The else keyword can be used with which of the following?

Your Answer : All of the above

4. >>>"abcd"[2:] (output of the line is….?

Your Answer : cd

5. On assigning a value to a variable inside a function, it automatically becomes a global variable.

Your Answer : False

6. Which of the following is the use of function in python?

Your Answer : Functions are reusable pieces of programs

7. What is called when a function is defined inside a class?

Your Answer : Method

8. Which of the following is incorrect file handling mode in Python?

Your Answer : t+

9. What are the two main types of functions?

Your Answer : Built-in function & User defined function

10. Which keyword is used for function?

Your Answer : Def

11. In Python 3 , the maximum value for an integer is 263-1 .

Your Answer : False

12. The output of executing string.ascii_letters can also be achieved by:

Your Answer : string.ascii_lowercase+string.ascii_uppercase

Page 1 of 2
13. >>>print('new' 'line') (output of the line is….?

Your Answer : Newline

14. Which arithmetic operators cannot be used with strings?

Your Answer :–

15. What is the output of the code? True = False While True : Print(True) Break

Your Answer : False

Correct Answer : None

Page 2 of 2

You might also like