Quiz on Basic Concepts in Python
Q.1. What is the correct file extension for Python files?
Q.2. What is the output of the following code?
listOne = [20, 40, 60, 80]
listTwo = [20, 40, 60, 80]
print(listOne == listTwo)
print(listOne is listTwo)
Q.3. What is the output of the following code?
var= "James Bond"
print(var[2::-1])
Q.4. Which of the following is correct?
Q.5. Python syntax is case-sensitive.
Q.6. Which operator has higher precedence in the following list
Q.7. What is the output for -
'python ' [-3]
Q.8. What is output of following code -
x = 2
y = 10
x * = y * x + 1
Q.9. What is the output of the following code?
str = "pynative"
print (str[1:3])
Q.10. The 'in' operator is used to check if a value exists within an iterable object container such as a
list. This operation returns True if it finds the specified value in the specified sequence and False
otherwise.
Q.11. What is output for:
max(''please help '')
Q.12. What is the output of the following code?
def nprint(message, n):
while(n > 0):
print(message)
n-=1
nprint('z', 5)
Q.13. What is the possible output of the following code?
sampleSet = {"Jodi", "Eric", "Garry"}
sampleSet.add("Vicki")
print(sampleSet)
Q.14. What is the output of the following code?
var = "James" * 2 * 3
print(var)
Q.15. What is the output of the following code?
p, q, r = 10, 20 ,30
print(r, p, q)
Instructions:-
- This Quiz is based on the basic concepts of Python
- Each correct answer will carry 2 points
- Once an option is selected you cannot select any other, So choose wisely
- Do not refresh the page as it will reset the quiz
- Once the time is up the quiz will automatically get submitted with no of Question responded
- Your total score alongwith your name will be shown after submission of the Quiz
- Wish you ALL THE BEST 👍👍
START
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP