
Python Quiz -6 Summer internship

Quiz
•
Other
•
University
•
Easy

Gnaneshwar Reddy
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements correctly defines a function in Python?
a) function myFunction()
b) def myFunction:
c) def myFunction():
d) define myFunction()
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code?
def add(a, b):
return a + b print(add(2, 3))
a) 2
b) 3
c) 5
d) None
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you call a function named myFunction in Python?
a) call myFunction
b) myFunction()
c) execute myFunction
d) myFunction
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following lists is a valid Python list?
a) (1, 2, 3)
b) {1, 2, 3}
c) [1, 2, 3]
d) 1, 2, 3
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
my_list = [1, 2, 3, 4]
print(my_list[2])
a) 1
b) 2
c) 3
d) 4
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you append an item to a list in Python?
a) list.add(item)
b) list.append(item)
c) list.insert(item)
d) list.appendList(item)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
def multiply_list(lst):
result = 1
for num in lst:
result *= num
return result
my_list = [1, 2, 3, 4]
print(multiply_list(my_list))
a) 10
b) 24
c) 12
d) None
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Stack Data Structure

Quiz
•
University
10 questions
Recordando JavaScript

Quiz
•
University
6 questions
Python

Quiz
•
University
10 questions
Test de JavaScript

Quiz
•
University
10 questions
Introduction to R for Data Science

Quiz
•
University
10 questions
BSHM 1A-Applied Business Tools- Quiz no.1 (Prelim)

Quiz
•
University
10 questions
Mastering Python Data Structures

Quiz
•
University
14 questions
2R C-Skill Lab Test Autumn 2024-25

Quiz
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade