I need help with my code for this in Python  This is what I have tried:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

I need help with my code for this in Python 

This is what I have tried: 

 

 
1 import math
2
3 def calc_num_pizzas (num_people):
return math.ceil(num_people / 6)
4
5
6
7 if
8
9
name ==
print("Pizzas:", calc_num_pizzas (int(input())))
main':
Develop mode Submit mode
Enter program input (optional)
4
Run program
Program output displayed here
Pizzas: 1
Run your program as often as you'd like, before submitting for grading. Below, type any needed
input values in the first box, then click Run program and observe the program's output in the
second box.
Input (from above)
main.py
(Your program)
Output (shown below)
le
Transcribed Image Text:1 import math 2 3 def calc_num_pizzas (num_people): return math.ceil(num_people / 6) 4 5 6 7 if 8 9 name == print("Pizzas:", calc_num_pizzas (int(input()))) main': Develop mode Submit mode Enter program input (optional) 4 Run program Program output displayed here Pizzas: 1 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box. Input (from above) main.py (Your program) Output (shown below) le
3.25 LAB: Pizza party
Given the number of people attending a pizza party, output the number of needed pizzas and total cost. For the calculation, assume that
people eat 2 slices on average and each pizza has 12 slices and costs $14.95.
Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
print (f'Cost: ${cost:.2f}')
Hint: Use the ceil() function from the math module to round up the number of pizzas so that enough pizzas are ordered.
Ex: If the input is:
4
the output is:
Pizzas: 1
Cost: $14.95
492462.2681420.qx3zqy7
LAB
ACTIVITY
3.25.1: LAB: Pizza party
1 import math
2
3
4
Type your code here. ''*
main.py
0/10
Load default template...
Transcribed Image Text:3.25 LAB: Pizza party Given the number of people attending a pizza party, output the number of needed pizzas and total cost. For the calculation, assume that people eat 2 slices on average and each pizza has 12 slices and costs $14.95. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print (f'Cost: ${cost:.2f}') Hint: Use the ceil() function from the math module to round up the number of pizzas so that enough pizzas are ordered. Ex: If the input is: 4 the output is: Pizzas: 1 Cost: $14.95 492462.2681420.qx3zqy7 LAB ACTIVITY 3.25.1: LAB: Pizza party 1 import math 2 3 4 Type your code here. ''* main.py 0/10 Load default template...
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Top down approach design
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning