590 Answered Questions for the topic Python
how to go about coding this in python?
Write a function that asks for the user to enter a number of items they wish to purchase.
multiple choice for python
What is the main difference between a dictionary and a list?A list can contain a dictionary however a dictionary cannot contain a list.There is no difference.The items stored in a dictionary are...
more
how to use set to return Mississippi in python
Write an expression that would turn the string "Mississippi" into a set of unique letters.For example:set("Parallel") would return set {"P", "a", "e", "l", "r"}You should only write one line of...
more
how to code this in python?
in python: Using keys and indexing, grab the "hello" from the following dictionaries:6a.d = {'simple_key':"hello"}6b.d = {"k1":{"k2":"hello"}}
4d
how to code this in python
In python: Reassign "hello" in this nested list to say "goodbye" instead:list1 = [1, 2, [3, 4, "hello"]]
5d
how to code this in python
Create a dictionary of technical terms and allow the user to lookup the definitions of these terms from the dictionary. Use the following list for your dictionary:'dict', 'list', 'map', or...
more
5d
how to use comma code in python
Comma CodeSay you have a list value like this:characters = ["Thor", "Thanos", "Black Panther", "Iron Man", "Hulk", "Batman", "Captain America"]Write Python code that coverts the list into a string...
more
5d
how to code this in python
you are creating a fantasy video game. The data structure to model the player’s inventory will be a dictionary where the keys are string values describing the item in the inventory and the value is...
more
5d
how to merge dictionaries in python
in python: Create the same dictionary as in exercise 3 but also create a second dictionary with only the season of Winter. Use the dictionary.update method to merge the winter dictionary into the...
more
5d
How to use dictionary in python
in python: Create a dictionary of the seasons Fall, Spring and Summer where the name of the season is the key and the value is a list of the months in that season. Print the value of "Fall".
5d
how to do dictionaries in python
In python: Use any names and birthdays you want to create a birthday dictionary that has four entries. The name is the key and the value is the birth date. Print each birth date by using the key...
more
How to slice the following code
In python:Use the slicing syntax of lists to get every other entry in the following list starting at the beginning and print the results.['a','b','c','d','e','f','g']Sample output:['a', 'c', 'e', 'g']
more
how to slice in python
In python: Use the slicing syntax of lists to get the first 4 numbers in the following list and print out the results.[1,2,3,4,5,6,7,8,9]
How to get a list of str and turn them to ints to add
Use the string.split method create a list of numbers from the following string and then sum up the numbers. Print the sum to the screen.'90,67,87,102,77,80'
Python Computer Programming
13d
Python function help
I have to write this same basic function six different times, changing the formula in the function each time. I need help getting the first function right. we have a prompt like this for each of...
more
14d
How would I start this program
I have def ted_fruit(fruit,fruit_quantity,fruit_cost). Ted, the TA, wants to buy fruit from the grocery. Define a function named ted_fruit(fruit, fruit_quantity, fruit_cost) that takes in the name...
more
15d
Code troubleshooting
Fruit_List = ["apple", "pear", "peach", "banana"]
Fruit_Name = input("Enter Fruit of Choice Here: ")
Fruit_Count = 0
for Fr in Fruit_List:
if Fr.lower() == Fruit_Name.lower():
...
more
Python Computer Science
15d
To add a curve to the amount of grades being printed.
Code in python. Given the following list of student test scores, apply a class "curve" to each score. The class curve is as follows: 90 or above: no curve80 to 90: +2 points70 to 80: +5 pointsLower...
more
Python Computer Science
15d
indentation error
sentence = input("Enter a word:")
vowel_count = 0
for i in sentence:
if(i == "a" or i == "e" or i == "i" or i == "o" or i == "u"):
vowel_count = vowel_count + 1
print("Total vowel count :",...
more
Python Computer Science
15d
How to do a for loop to do this
#3.2 Find the vowels – for loop (4.5 points)Using the 'if' statement and the 'or' operator, write a program that uses the input() function and asks the user for a word or sentence.Print the number...
more
Python Computer
16d
to write a code block on python that will answer the below
Write a simple "shopping cart" program that asks the user for a series of product prices. Compute sales tax (7%) on each price and print out the new price to the user. Next, ask the user if they...
more
Python
16d
how to write a program in python that takes the coin value entered and spits out what coin that is
Write a program that asks the user for the value of a coin. Then determine what kind of coin they entered using this information. 1 = “Penny”5 = “Nickle”10 = “Dime”25 = “Quarter”50 = “Half...
more
16d
How to code in python something that will take your inputs of items bought and add them with tax
Calculates the total including sales tax (8.875%) of a shopping trip.Create a total variable and a tax variable. Total the items calculated with tax. Be sure to test if the price is above...
more
Python Computer Programming
17d
python programming
temperature = int(input("What temperature is the weather today?"))
if temperature < 40:
print("Wear a warm coat")
elif temperature < 70:
print("Wear a light jacket")
elif temperature...
more
Python Computer Programming
21d
How can I get it to divide decimals without it crashing
The program works fine with whole numbers, as soon as I enter a decimal like 2.5 it crashes. CLASS = str(input("What is the name of your class: "))HOURS = int(input("How many hours a week do you...
more
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.