Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Community ▾
A
A
Quizzes
/
A program imports the random module and then uses its name again for a number. What happens when the program runs?
Python Programming
Medium
High School (11–12)
Python Essentials › Modules and Libraries
Class 12 Board
PCAP (Python Institute)
+1 more exams
AP
AP
PCAP (Python Institute)
Created by
StemPy Lab
Stuck? Show a hint
A program imports the
random
module and then uses its name again for a number.
import random random.seed(1) random = random.randint(4, 4) print(random + 1, random.randint(1, 2))
What happens when the program runs?
It stops with
NameError
It stops with
TypeError
5 1
It stops with
AttributeError
Check Answer
Log in to save
Tag someone
⚑ Report
← All Quizzes
← A program starts with two import lines. Each option below is then run as the next line of the program, on its own. Which lines run with no error? Choose every correct option.
A program imports the math module and tests five results of its functions. Which of these expressions are True? Select all that apply. →
More on
Python Essentials › Modules and Libraries
Discussion (0)
Log in
to join the discussion.
Loading…
All questions on this topic →
Problems on this topic
A shop sells these items on one day, with the prices [20, 25, 25, 30, 22, 28, 400]…
Easy
Roll two dice 6000 times, with the seed 3…
Medium
Which module would you use for each job? …
Easy
Find out, with dir and help, which function of math gives the sine of an angle, and which gives the…
Easy
All problems on this topic →