Python Unit 3

Quiz
•
Computers
•
University
•
Easy
Vishwanath Vishwanath
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
s = "Python Programming"
print(s[7:18])
Programming
Python
Python Programming
Programmin
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you define a list in Python?
list = {1, 2, 3, 4}
list = [1, 2, 3, 4]
list = "1, 2, 3, 4"
1 ,2,3,4
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to define a tuple?
t = (1, 2, 3, 4)
t = "1, 2, 3, 4"
t = {1, 2, 3, 4}
None
4.
FILL IN THE BLANK QUESTION
1 min • 1 pt
A tuple is an ___sequence in Python,
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
d = {"a": 1, "b": 2, "c": 3}
print(d.get("d", 10))
10
d
Error
D 10
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
s = "python programming"
print(s.title())
"Python Programming"
"PYTHON PROGRAMMING"
"Python programming"
Error
Answer explanation
The title() method capitalizes the first letter of each word in the string.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you define a function in Python?
func function_name():
define function_name():
function function_name():
def function_name():
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
C Basics

Quiz
•
University
10 questions
Python Generators

Quiz
•
10th Grade - University
10 questions
Python

Quiz
•
University
15 questions
Python Programming Intermediate-1

Quiz
•
University
15 questions
CSE 102 Exam 2 Practice

Quiz
•
University
12 questions
CSSE Quiz Day2

Quiz
•
University
10 questions
Python Programming Concepts Challenge

Quiz
•
10th Grade - University
10 questions
OOP intro quizz

Quiz
•
University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade