Questions LLC
Login
or
Sign Up
Ask a New Question
Python Programming
Page 2
Questions (153)
What does the append() function do to a Python list?
(1 point) Responses It adds an item to the beginning. It adds an item to the
3 answers
asked anonymously
118 views
Which of these is NOT a primitive data structure in Python?
(1 point) Responses string string Boolean Boolean set set float
3 answers
asked anonymously
44 views
What is the output of this program?
availableColors = ["red", "yellow", "blue"] availableColors.insert(1, "orange")
3 answers
asked anonymously
57 views
What is the output of this program?
sideItems = {"steak" : "baked potato", "enchiladas" : "rice and beans", "poke bowl" :
3 answers
asked anonymously
92 views
FIX THE CODE
class Chatbox: def __(user): user.responses = { "hi": "Hello! How can I assist you with recycling today?", "what can
3 answers
asked anonymously
42 views
FIX BAD INPUT ON LINE 38
import random # Greeting messages greetings = [ "Hi there! I'm your recycling bot. How can I assist you
3 answers
asked anonymously
46 views
FIX BAD INPUT ON LINE 23
import random # Greeting messages greetings = [ "Hi there! I'm your recycling bot. How can I assist you
3 answers
asked anonymously
45 views
if you want the words "my puppy is a poodle" to appear in the output box, what Python code should you use?
3 answers
asked anonymously
78 views
What is the output of this program? availableColors = ["red", "yellow", "blue"] del availableColors[0] print(availableColors[1])
10 answers
asked by
Based on the Law of Conservation of Energy, which
55 views
Computer programs written in Python start as source files or source code. These files, normally ending with a ".py" extension,
1 answer
asked anonymously
69 views
Consider this program:
class Toolkit(): def __init__(self, type): self.hasHammer = False; self.hasWrench = False; self.hasPliers
1 answer
asked by
Blue
18 views
Consider this program:
class Toolkit(): def _init__(self, type): self.hasHammer = False; self.hasWrench = False; self.hasPliers =
1 answer
asked by
Blue
32 views
Consider this program:
class Students: def __init__(self, name, grade): self.name = name self.grade = grade student34 = Students
1 answer
asked by
Blue
52 views
Consider this program:
class Toolkit(): def __init__(self, type): self.hasHammer = False; self.hasWrench = False; self.hasPliers
1 answer
asked by
Blue
47 views
The range function in Python has the definitions range(stop) or range(start, stop[, step]). The following code snippet will
4 answers
asked anonymously
78 views
Consider the recursive function for the calculation of a factorial.
def factorial(n): if n == 1: return n else: return n *
1 answer
asked anonymously
127 views
Consider this program:
class Toolkit(): def __init__(self, type): self.hasHammer = False; self.hasWrench = False; self.hasPliers
1 answer
asked anonymously
46 views
You are reviewing a Python program that includes this line of code: import numpy. Which of the following is this program most
1 answer
asked anonymously
83 views
class Students:
def __init__(self, name, grade): self.name = name self.grade = grade student34 = Students("Maria", 10) student35
1 answer
asked anonymously
65 views
Consider this program:
class Toolkit(): def __init__(self, type): self.hasHammer = False; self.hasWrench = False; self.hasPliers
1 answer
asked anonymously
77 views
write a multiplication table in python from 1-10 using loops
1 answer
asked anonymously
20 views
If you run the starting program below, you will get an error because you can't directly add numbers to strings. Use the str()
4 answers
asked anonymously
46 views
Which of the following correctly matches a function to its purpose?(1 point) Responses data.info() displays the count, mean,
1 answer
asked by
hatemaths
51 views
The built-in Python function slice allows the programmer to select portions of the input that they want to slice out. It has two
1 answer
asked by
hatemaths
48 views
If you want to add a third option to if and else, you can use:
(1 point) Responses print print input input alter alter elif
11 answers
asked anonymously
104 views
Mirembe created some code so that Python 3 can be used as a calculator to multiply 67 by 15. The code reads print 67 * 15, but
1 answer
asked anonymously
154 views
What is the purpose of the first parameter in the str.format() function?
Select one: a. To control the overall width of the
1 answer
asked anonymously
45 views
The program below has multiple print() statements that display text on individual lines. Modify the print() statements (where
1 answer
asked anonymously
47 views
The program below should ask the user for their two favorite things and print them in messages. The print() statements are
1 answer
asked anonymously
44 views
The program below should ask the user for their two favorite things and print them in messages. The print() statements are
5 answers
asked anonymously
45 views
In this chapter, you learned how to nicely format strings using the print() and str.format() functions. You also learned how to
5 answers
asked anonymously
49 views
complete this code
num1 = int(input("6: ")) num2 = int(input("8: ")) total = for num in range(num1, num2+1): total += num
1 answer
asked by
joe
33 views
Get ready to be the Quizmaster! You are going to design your own Python game show in the style of a quiz.
Think of a genre
11 answers
asked anonymously
79 views
Get ready to be the Quizmaster! You are going to design your own Python game show in the style of a quiz.
Think of a genre
9 answers
asked anonymously
38 views
Напишите функцию swap (python), которая получает список и меняет местами 1-й
1 answer
asked anonymously
30 views
If you want the words "My puppy is a poodle" to appear in the output box, what Python code should you use?
(1 point) O create "My
1 answer
asked anonymously
35 views
In Python, what does the choice function do?
(1 point) Olets the user make a choice lets the programmer make a choice O creates a
1 answer
asked anonymously
24 views
If you want to add a third option to if and else, you can use:
(1 point) O print input O alter O elif
1 answer
asked anonymously
15 views
When a program written in Python is running, the computer can understand:
1 answer
asked by
Blue
23 views
The program below asks the user to enter how many lives they have left in a game. Your code should respond to the user's input
7 answers
asked anonymously
43 views
Create a basic hello world program in Python.
1 answer
asked anonymously
34 views
How many lines of output will be shown from the following code?
print("Line 1", end = " ") print("Line 2") print("Line 3", end =
1 answer
asked anonymously
18 views
Identify the error in the syntax of the following code:
def is_year(year): if year % 4 == 0: print('Year is divisible by 4') else
1 answer
asked by
Hayden
37 views
The program below is designed to ask a user their age and then print how old the user will be in ten years, along with the year
1 answer
asked anonymously
31 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
156 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
135 views
Which of the following would print out the length of a list called swim_times?
(1 point) Responses print(swim_times)
1 answer
asked anonymously
123 views
Which of the following would print the final item in a list called soccer_players?
(1 point) Responses print(soccer_players[+1])
1 answer
asked anonymously
118 views
Create a loop to display all even numbers from 0 to 100 in python
1 answer
asked anonymously
46 views
What is the output of the following code?
count = 0 while count < 10: print(count, end="") count += 1
1 answer
asked anonymously
43 views
Pages
1
2
3
4
Parent Categories (17)
Code/Programming
Coding
Coding/Programming
Computer Programming
Computer Science
Computer Science/Programming
Programming
Programming and Software Development
Programming Concepts
Programming Language
Programming Languages
Programming Languages and Tools
Programming or Computer Science
Programming Syntax
Programming/Code Syntax
Random Number Generation
Web Development