Question

To build a widget you need 3 thing-ama-bobs, 2 doohickies and 4 nails. write a python...

To build a widget you need 3 thing-ama-bobs, 2 doohickies and 4 nails. write a python program that prompts the user for how many widgets they want to build and then prints out the total list of parts needed

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Python code:

num_of_ama_bobs_per_widget = 3 #since every widget needs 3 ama-bobs

num_of_doohickies_per_widget = 2 #since every widget needs 2 doohickies

num_of_nails_per_widget = 4 #since every widget needs 4 nails

num_of_widgets = int(input("Please enter the number of widgets you want to build: ")) #prompting and reading input

total_ama_bobs = num_of_widgets * num_of_ama_bobs_per_widget #calculating the no of ama_bobs needed

total_doohickies = num_of_widgets * num_of_doohickies_per_widget #calculating the no of doohickies needed

total_nails = num_of_widgets * num_of_nails_per_widget #calculating the no of nails needed

print("Total number of parts needed:") #printing the number of parts needed of each type

print("Ama-Bobs = "+str(total_ama_bobs))

print("Doohickies = "+str(total_doohickies))

print("Nails = "+str(total_nails))

Screenshot of the code's output:

PLEASE UPVOTE!!

Add a comment
Know the answer?
Add Answer to:
To build a widget you need 3 thing-ama-bobs, 2 doohickies and 4 nails. write a python...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • The Yukon Widget Company manufactures widgets that weigh 9.2 pounds each. Write a Java program that calculates how many...

    The Yukon Widget Company manufactures widgets that weigh 9.2 pounds each. Write a Java program that calculates how many widgets are stacked on a pallet, based on the total weight of the pallet. The program should ask the user how much the pallet weighs by itself and with the widgets stacked on it. It should then calculate and display the number of widgets stacked on the pallet. (you can have partial widgets)

  • 1) Translate the following equation into a Python assignment statement 2) Write Python code that prints...

    1) Translate the following equation into a Python assignment statement 2) Write Python code that prints PLUS, MINUS, O ZERO, depending on the value stored in a variable named N. 3) What is printed by: 3 - 1 while 5: while 10 Print ) Page 1 of 9 4) Write a Python while loop that reads in integers until the user enters a negative number, then prints the sum of the numbers. 1-2 of 9 4) Write a Python while...

  • Can you help me write a Python 3.7 code for this question? Write a program using...

    Can you help me write a Python 3.7 code for this question? Write a program using functions and mainline logic which prompts the user to enter a number, then generates that number of random integers and stores them in a list. It should then display the following data to back to the user: The list of integers The lowest number in the list The highest number in the list The total sum of all the numbers in the list The...

  • Help needed related python task ! Thanx again How you're doing it • Write a function...

    Help needed related python task ! Thanx again How you're doing it • Write a function write_to_file() that accepts a tuple to be added to the end of a file o Open the file for appending (name your file 'student_info.txt') o Write the tuple on one line (include any newline characters necessary) o Close the file • Write a function get_student_info() that o Accepts an argument for a student name o Prompts the user to input as many test scores...

  • In python Please type the code Question 4: Write a program that reads an English word...

    In python Please type the code Question 4: Write a program that reads an English word from the user, and prints how many vowels and how many consonants it contains. Note: You may assume the letter Y is not a vowel. Sample output (2 different executions) Enter a word: test test has 1 vowels and 3 consonants Enter a word: Apple Apple has 2 vowels and 3 consonants.

  • Python 3 **11.40 (Guess the capitals) Write a program that repeatedly prompts the user to enter...

    Python 3 **11.40 (Guess the capitals) Write a program that repeatedly prompts the user to enter a capital for a state. Upon receiving the user input, the program reports whether the answer is correct. Assume that 50 states and their capitals are stored in a two- dimensional list, as shown in Figure 11.13. The program prompts the user to answer all the states’ capitals and displays the total correct count. The user’s answer is not case sensitive. Implement the program...

  • Write a python program where you create a list (you an create it in code you...

    Write a python program where you create a list (you an create it in code you do not have to use input() statements) that represents the total rainfall for each of 12 months (assume that element 0 is January and element 11 is December). The program should calculate and display the: 1) total rainfall for the year; 2) the average monthly rainfall; 3) the months with the highest and lowest amounts. You need to figure out how to access each...

  • Please use Python 3, thank you~ Write a program that: Defines a function called find_item_in_grid, as...

    Please use Python 3, thank you~ Write a program that: Defines a function called find_item_in_grid, as described below. Calls the function find_item_in_grid and prints the result. The find_item_in_grid function should have one parameter, which it should assume is a list of lists (a 2D list). The function should ask the user for a row number and a column number. It should return (not print) the item in the 2D list at the row and column specified by the user. The...

  • Python Code Write a program using functions and mainline logic which prompts the user to enter...

    Python Code Write a program using functions and mainline logic which prompts the user to enter a number. The number must be at least 5 and at most 20. (In other words, between 5 and 20, inclusive.) The program then generates that number of random integers and stores them in a list. The random integers should range from 0 to 100. (You can use a wider range if you want, but the lower end of the range must be at...

  • Write a Python program that prints a name as shown in the image below. The program...

    Write a Python program that prints a name as shown in the image below. The program asks the user to enter a name and how many time the user wants to display the name.. You need two to input two integer values. First, for repeating name in a row. Second, for number of rows. In total, your program will have three inputs. Add three comment lines at start of the program, which shows program purpose, your name and date. Hint:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT