Python Variables and DataTypes Quiz
Python is said to be the easiest language on earth and no doubt the reason behind it. It comes with the easiest set of rules with increased usability. Also, Python is useful in Scalable systems these days due to the ease of use.
Let us start the quiz now to check our understanding of variables and the Datatypes of Python.
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Results
Results
0 of 15 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- Current
- Review / Skip
- Answered
- Correct
- Incorrect
- Question 1 of 15
1. Question
Find the error in the following code:
# Code Snippet Start
for = 98
value = 100+for
print(“Value is “,value)
#Code Snippet End
CorrectIncorrect - Question 2 of 15
2. Question
Find the output of the following python code:
# Code Snippet Startval = ‘5’
num = 10
print(“When we add “+val+” and “+num+” we get “+(val+num))#Code Snippet End
CorrectIncorrect - Question 3 of 15
3. Question
Which of the following is not a standard Python datatype?
CorrectIncorrect - Question 4 of 15
4. Question
What will be the output of the following code fragment?
# Code Snippet Start
array = {
‘name’: ‘Rita’,
‘Organisation’:’QuizOrbit’,
‘Age’: 45,
}
print(type(array) , type(array[‘Age’]))
#Code Snippet End
CorrectIncorrect - Question 5 of 15
5. Question
Which of the following doesn’t come under the number Datatype in Python?
CorrectIncorrect - Question 6 of 15
6. Question
What is the output of the following code?
# Code Snippet Start
employee = [
{‘name’: ‘Raj’, ‘Org’: ‘QuizOrbit’,’Age’:50},
{‘name’: ‘Rita’, ‘Org’: ‘QuizOrbit’,’Age’:25},
{‘name’: ‘Shivi’, ‘Org’: ‘QuizOrbit’,’Age’:22},
{‘name’: ‘Amey’, ‘Org’: ‘QuizOrbit’,’Age’:48},
{‘name’: ‘Nita’, ‘Org’: ‘QuizOrbit’,’Age’:39},
]
print(employee[2][‘Org’])
#Code Snippet End
CorrectIncorrect - Question 7 of 15
7. Question
What is the code that we need to put as the value of ‘?’ to get the following output from the given code?
# Code Snippet StartuserVal = ‘I am Amey. And I am a Software Developer at QuizOrbit.’
name = userVal[5:9]
workOrganisaton = ?
print(“Name: “+name)
print(“Organisation: “+workOrganisaton)#Code Snippet End
#Output Start
Name: Amey
Organisation:
QuizOrbit
#Output EndCorrectIncorrect - Question 8 of 15
8. Question
What is one particular property of Python tuples?
CorrectIncorrect - Question 9 of 15
9. Question
Which of the following is an immutable Python datatype?
CorrectIncorrect - Question 10 of 15
10. Question
What is the output of the following code snippet in Python?
# Code Snippet StartstringVal = ‘Hello from QuizOrbit’
val = stringVal.split(” “)
print(val)#Code Snippet End
CorrectIncorrect - Question 11 of 15
11. Question
What is the output of the following Python code?
# Code Snippet Startval = (‘id: Ab3’, ‘name: Rajeev’)
valSecondary = (’26’, ‘QuizOrbit’)
print(val+valSecondary)#Code Snippet End
CorrectIncorrect - Question 12 of 15
12. Question
What is the output of the following code? # Code Snippet Start
arr = [1,2,3,2,1,5,6,7,4,2,3,8,5,9,3]
count = {}
for i in arr:
if i in count:
count[i]+=1
else:
count[i]=1
print(count[2])
#Code Snippet End
CorrectIncorrect - Question 13 of 15
13. Question
What is the output of the following Python code?
# Code Snippet Start
val = ‘AuizOrbit’
# Replace wrong character by correct character
val[0] = ‘Q’
print(val)
#Code Snippet End
CorrectIncorrect - Question 14 of 15
14. Question
Which of the following is an immutable dataType in python?
CorrectIncorrect - Question 15 of 15
15. Question
What is the output of the given code?
# Code Snippet Startorg = ‘QuizOrbit’
print(org[::-1])#Code Snippet End
CorrectIncorrect
Summary
Here we arrive at the end of our quiz. We encourage you to proceed with the next quiz to check your concepts.