Python Forum
Plz help Ive tried for hours and cant do these three problems
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plz help Ive tried for hours and cant do these three problems
#1
So I am stuck on number 2 right now but if someone could help guide me it would be very appreciated. I cant figure out how to use an "if" statement with two variables. Im on python 3.6.

2) At the local sports store, footballs are priced at $30 each if fewer than six are purchased, $28 each if at least six but fewer than twelve are purchased, and $26 each if at least twelve are purchased. Write a program that accepts the input from the user of how many footballs he/she would like to purchase, and outputs the cost.

3) A company pays an employee $5 per hour if she works 40 hours or less. If she works more than 40 hours, she gets $9 per hour for each extra hour. Write a program that accepts the input being the number of hours worked (assume an integer), and outputs the employees pay.
Reply
#2
What's the code you've tried?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Sad [Learning] 3 hours for one simple exercise KoFu 7 3,273 Sep-08-2019, 09:17 PM
Last Post: KoFu

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020