Python Programming Basics 1

Quiz
•
Computers
•
University
•
Hard
Madhu Baswani
Used 112+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Is Python case sensitive when dealing with identifiers?
Yes
No
Machine Dependent
None of the mentioned
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the maximum possible length of an identifier?
31 characters
63 characters
79 characters
None of the mentioned
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is an invalid variable?
my_string_1
1st_string
foo
_
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not a keyword?
assert
eval
nonlocal
pass
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following cannot be a variable?
__init__
in
it
on
Answer explanation
'in' is a keyword.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the code:
a=21; b=6
print(a/b); print(a//b); print(a%b)
What is the result?
3.0
3
3
3
3
3
3.5
3
3
3.5
3.5
3
Answer explanation
division operator in python always meant for floating point arithmetic. Hence a/b returns 3.5 But floor division(//) operator can perform both integral and floating point arithmetic. If the arguments are int type then the result is int type and if the arguments are float type then the result is float type. Hence a//b returns 3. a%b returns the remainder which is 3.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the code and What is the result?
s='AB CD'
list=list(s)
list.append('EF')
print(list)
('A','B',' ','C','D','EF')
['A','B','C','D','E','F']
{'A','B',' ','C','D','EF'}
['A','B',' ','C','D','EF']
Answer explanation
List elements will be printed within square brackets.
Whenever we are converting string to list, each character will become element of List including space also.
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Beginner Quiz on ML and Python Basics

Quiz
•
University
20 questions
9.4.25 Mentoring quiz

Quiz
•
University
20 questions
CSS Quiz

Quiz
•
University
20 questions
INTRO TO C++

Quiz
•
12th Grade - University
20 questions
PY-BUILD

Quiz
•
University
20 questions
Final Quiz

Quiz
•
University
25 questions
PYTHON CONTEST 2

Quiz
•
University
25 questions
Assignment 2(CIVIL)

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University