TechantCode
Home
(current)
Python Quiz
Mar 24, 2021
Q1. What is python?
Python is an interpreted,object-oriented,high-level programming language.
Install Python
Mar 24, 2021
Q2. Select the integer literal.
a) 10.345
b) 10
c) '12'
Answers
b) 10
Mar 24, 2021
Q3. What is the output of this code?
>> int("30"+"40")
a) "70"
b) "3040"
c) 3040
Answers
c) 3040
Mar 24, 2021
Q4. do you insert COMMENTS in Python code?
a) //This is comment
b) /*This is comment
c) #This is comment
Answers
c) #This is comment
Mar 24, 2021
Q5. The input() function takes user's input as a
a) string
b) float
c) integer
Answers
a) string
Mar 24, 2021
Q6. How many numbers will be printed?
i = 10
while i>=0:
print(i)
i=i-1
a) 10
b) 11
c) 9
Answers
b) 11
Mar 24, 2021
Q7. Which of the following is placed after the if condition?
a) ;
b) .
c) :
Answers
c) :
Mar 24, 2021
Q8. What is the output of this code?
import randomas r
print(random.randomint(1,10))
a) An error occurs
b) 10
c) 1
Answers
a) An error occurs
Mar 24, 2021
Q9. Modules are files saved with __ extension
a) mod
b) .py
c) imp
Answers
b) .py
Mar 24, 2021
Q10. Find The Output
s = "Welcome"
print(s[1:3])
a) Wel
b) el
c) elo
Answers
b) el
1
2