Questions LLC
Login
or
Sign Up
Ask a New Question
Python
Page 6
Questions (402)
What will this line of code do?
numpy.sum(item_prices) (1 point) Responses create a variable called item_prices to hold the sum
1 answer
asked anonymously
22 views
Consider this program:
class Students: def __init__(self, name, grade): self.name = name self.grade = grade student34 =
1 answer
asked anonymously
20 views
Consider this program:
class Toolkit(): def __init__(self, type): self.hasHammer = False; self.hasWrench = False; self.hasPliers
1 answer
asked anonymously
17 views
What statement must occur before this line of code?
numpy.average(scores) (1 point) Responses import numpy import numpy import
1 answer
asked anonymously
28 views
Consider this program:
class Toolkit(): def __init__(self, type): self.hasHammer = False; self.hasWrench = False; self.hasPliers
1 answer
asked anonymously
20 views
Consider this program:
class Students: def __init__(self, name, grade): self.name = name self.grade = grade student34 =
1 answer
asked anonymously
20 views
When are triple quotes likely to be used in a Python program?
(1 point) Responses in object-oriented design in object-oriented
1 answer
asked anonymously
29 views
The first parameter in every class method is typically named:
(1 point) Responses self self __init__ __init__ class class def
1 answer
asked anonymously
17 views
How can you identify special methods in Python such as constructors?
(1 point) Responses parentheses parentheses dunders dunders
1 answer
asked anonymously
28 views
What error in this program needs to be fixed?
def sum(num1, num2) return num1 + num2 print(sum(4, 5)) (1 point) Responses The
1 answer
asked anonymously
24 views
What error in this program needs to be fixed?
def sum(num1, num2): return num1 + num2 print(sum(4, 5.5, 6)) (1 point) Responses
1 answer
asked anonymously
25 views
phrase = input("Please enter a phrase: ")
index = 0 for i in phrase: if i == " ": print("Space at index", index) index += 1
11 answers
asked anonymously
40 views
When a program written in Python is running, the computer can understand:
(1 point) Responses the Python code, including
1 answer
asked anonymously
32 views
Which of these would you use to write Python code in a functional way?
(1 point) Responses print() print() def printScore() def
1 answer
asked anonymously
20 views
The program below should repeatedly take a user's food order and echo the message "Yum, I love X", where X is the input food.
1 answer
asked anonymously
35 views
The program below asks the user to enter a phrase as a string. It should then print out that same string, replacing any
1 answer
asked anonymously
28 views
how do you create a function in python
1 answer
asked anonymously
19 views
Which of the following pieces of information is present in messages printed when Python finds a syntax error in your code?
Select
1 answer
asked anonymously
26 views
If Python identifies a particular line of code as having a syntax error, where should you look to find and fix the problem?
Selec
1 answer
asked anonymously
36 views
What is the output of the following code?
count = 0 hobby = "marbles" for letter in hobby: count = count + 1 print(str(count))
3 answers
asked anonymously
36 views
there is still a problem whith line 10 it's the if choice == "1":
1 answer
asked by
mznxbvcxvzbn
16 views
1print("Welcome to the Text-based Adventure Game!")
2print("You wake up in a dark room with no memory of how you got there.")
1 answer
asked by
mznxbvcxvzbn
22 views
1print("Welcome to the Text-based Adventure Game!")
2print("You wake up in a dark room with no memory of how you got there.")
1 answer
asked by
mznxbvcxvzbn
22 views
Which line of code would print the first item in a list named pens? (1 point) Responses print[pens(1)] print[pens(1)]
1 answer
asked anonymously
37 views
Which of these is a correct example of the creation of a list in Python? (1 point) Responses names = [“James”, “Omar”,
1 answer
asked anonymously
30 views
Sonia has a list called colleges with 10 entries and wants to print the final item on the list. Which code should be used? (1
1 answer
asked anonymously
39 views
Which of the following lines of code would correctly add an item to a list called classes? (1 point) Responses
1 answer
asked anonymously
32 views
In a Python list, what is the index of the first item? (1 point) Responses 0 0 1 1 10 10 A
1 answer
asked anonymously
16 views
result = square(4)
print(result) # This would output: 16
1 answer
asked anonymously
23 views
result = square(4)
print(result) # This would output: 16 please explain
1 answer
asked anonymously
23 views
which line of code would force a python program to end?
over() exit() end() depart()
5 answers
asked anonymously
37 views
How would you create a shopping list in Python?
1 answer
asked anonymously
34 views
How would you create a shopping list in Python? eggs, milk, water, apples, oranges
1 answer
asked anonymously
24 views
Which module do you need to import if you want to have a pause in a Python program so that text doesn’t all get printed at
1 answer
asked anonymously
49 views
Which term best describes these lines?
count = 0 loop through list if “basketball” is found add one to count output count (1
1 answer
asked anonymously
50 views
When using the time.sleep() method, what should go in the parentheses?
(1 point) Responses nothing nothing length of pause in
1 answer
asked anonymously
43 views
Which line of code would force a Python program to end?
(1 point) Responses over() over() exit() exit() end() end() depart()
1 answer
asked anonymously
71 views
Sonia has a list called colleges with 10 entries and wants to print the final item on the list. Which code should be used?
1 answer
asked anonymously
50 views
Which of the following would print out the length of a list called swim_times?
1 answer
asked anonymously
18 views
What line of code contains an error?
student_name = "Jenna" if student_name(0).lower() == "a": print('Winner! Name starts with
1 answer
asked anonymously
60 views
What will the following code output?
student_name = "Matthew" print(student_name[-2])
1 answer
asked anonymously
36 views
_____ errors violate the rules for how Python statements must be written.
Group of answer choices Syntax
1 answer
asked anonymously
29 views
Review the following code. The user enters 400 for milesDriven and 0 for gallonsUsed. What will print out?
try:
1 answer
asked anonymously
65 views
In the following Python error message, what is the exception type, and what line did the error occur on?
RESTART:
1 answer
asked anonymously
56 views
which module do you need to import if you want to have a pause in a Python program so that text doesn't all get printed at once?
1 answer
asked by
Kee
62 views
Which module do you need to import if you want to have a pause in a Python program so that text doesn’t all get printed at
1 answer
asked anonymously
29 views
Which of the following lines of code would cause the program to wait one minute before executing the next line? (1 point)
1 answer
asked anonymously
47 views
Which line of code would force a Python program to end? (1 point) Responses over() over() exit() exit() end() end() depart()
1 answer
asked anonymously
20 views
When using the time.sleep() method, what should go in the parentheses? (1 point) Responses nothing nothing length of pause in
1 answer
asked anonymously
65 views
When using the time.sleep () method, what should go in the parentheses?
A. Nothing B. Length of pause in minutes C. Length of
1 answer
asked by
Kee
38 views
Pages
1
2
3
4
5
6
7
8
9
Parent Categories (17)
Application Development
Coding
Coding/Programming
Computer Programming
Computer Science/Programming
Interpreted Languages
Invasive Species
Libraries
Programming
Programming Language
Programming Languages
Programming or Computer Science
Programming/Code
Random Number Generation
Reptiles
Software or Programming
Web Development