Devin Dahlberg

Python: Assignment Three

#Write a while loop that lets the user enter a number. The number should be multiplied by 10, and the result assigned to a variable named product. The loop should iterate as long as product is less than 25. The following should be the program output if the numbers 0, 1, 2 and 3 are respectively entered
# Enter a number: 0
#0
#Enter a number: 1
#10
#Enter a number: 2
#20
#Enter a number: 3
#you entered a number whose product is greater than 25


product = 0

while product < 25:
    number = int(input('Please enter a number: '))
    product = number * 10
    print(product)

print("You entered a number whose product is greater than 25")

CH4P1

#Write a program that asks the user to enter the amount that he or she has budgeted for a week.
#A loop should then prompt the user to enter each of his or her expenses for each day of the week and keep a running total.
#When the loop finishes, the program should display the amount that the user is over or under budget.

#Ask user to enter budget amount
budget = int(input('Please enter your budget amount for a week: '))

#Loop
amount = 0

for day in ['Monday: ', 'Tuesday: ', 'Wednesday: ', 'Thursday: ', 'Friday: ', 'Saturday: ', 'Sunday: ']:

    print(day)
    daily = int(input())
    amount = amount + daily

if amount > budget:
    print("You are over budget.")

if amount < budget:
    print("You are under budget.")

if amount == budget:
    print("You are equal to your budget.")

CH4P2