
Py Day 5
Authored by hichem ayari
Computers
1st - 5th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the random.randint(a, b) function in Python?
Generate a random integer between a (inclusive) and b (exclusive).
Generate a random integer between a (inclusive) and b (inclusive).
Generate a random float between a (inclusive) and b (exclusive).
Generate a random float between a (inclusive) and b (inclusive).
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To use the random module in Python, what is the correct way to import it?
import random.random
import random
from random import random
from random import random as rand
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you create an empty list in Python?
list()
[]
new list[]
empty_list = []
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to access the element at index 2 in a list named my_list?
my_list[2]
my_list.get(2)
my_list.at(2)
get_element(my_list, 2)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of a 'for' loop in Python?
It is used to iterate over elements in a list or other iterable objects
It is used to execute a block of code repeatedly for a specified number of times
It is used to generate random numbers and store them in a list.
It is used to declare and initialize lists in Python.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to write a 'for' loop that prints each element in the list my_list?
for i in range(len(my_list)): print(my_list[i])
for i in my_list: print(my_list[i])
for element in my_list: print(element)
for index in range(my_list): print(my_list[index])
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the range() function in Python?
It generates a sequence of integers from 0 up to, but not including, a specified number.
It generates a sequence of integers from 1 up to, and including, a specified number.
It generates a sequence of integers with a specified start, end, and step size.
It generates a sequence of even numbers from 2 up to, and including, a specified number.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Программирование алгоритма 8 класс
Quiz
•
1st - 10th Grade
10 questions
Coding
Quiz
•
3rd - 6th Grade
10 questions
Year 4 | World wide web
Quiz
•
4th Grade
10 questions
Basic Algorithm elementary
Quiz
•
3rd - 5th Grade
13 questions
CS Fundamentals Quiz
Quiz
•
3rd Grade
8 questions
Create a folder
Quiz
•
3rd - 4th Grade
8 questions
I can use loops and conditionals in my algorithms!
Quiz
•
4th Grade
10 questions
Transmission Media
Quiz
•
1st Grade - University
Popular Resources on Wayground
8 questions
Spartan Way - Classroom Responsible
Quiz
•
9th - 12th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
14 questions
Boundaries & Healthy Relationships
Lesson
•
6th - 8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
3 questions
Integrity and Your Health
Lesson
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
9 questions
FOREST Perception
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
Discover more resources for Computers
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
18 questions
Comparing Fractions with same numerator or denominator
Quiz
•
3rd Grade
10 questions
Wayground Quiz Review for G2 Benchmark 3
Quiz
•
2nd Grade
10 questions
Area
Quiz
•
3rd Grade