Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #1
- number = int(input("Enter number: "))
- if number == 1:
- print("Monday")
- elif number == 2:
- print("Tuesday")
- elif number == 3:
- print("Wednesday")
- elif number == 4:
- print("Thursday")
- elif number == 5:
- print("Friday")
- elif number == 6:
- print("Saturday")
- elif number == 7:
- print("Sunday")
- elif number > 7 or number < 1:
- print("Invalid number")
- #2
- day = input("Enter a day of the week: ")
- if day == "Monday":
- print("Weekday")
- elif day == "Tuesday":
- print("Weekday")
- elif day == "Wednesday":
- print("Weekday")
- elif day == "Thursday":
- print("Weekday")
- elif day == "Friday":
- print("Weekday")
- elif day == "Saturday":
- print("Weekend")
- elif day == "Sunday":
- print("Weekend")
- else:
- print("ERROR")
- #3
- student = input("Enter the student's number: ")
- if student.startswith("23"):
- print("1st course")
- elif student.startswith("22"):
- print("2nd course")
- elif student.startswith("21"):
- print("3rd course")
- elif student.startswith("20"):
- print("4th course")
- elif student.startswith("19"):
- print("5th course")
- else:
- print("No such student")
- #4
- age = int(input("Enter the person's age: "))
- gender = input("What gender is the person(only male/female): ")
- if gender == "male":
- if age < 16:
- print("Master")
- elif age >= 16:
- print("Mr.")
- if gender == "female":
- if age < 16:
- print("Miss")
- elif age >= 16:
- print("Ms.")
- #5
- place = input("Dormitory, School, or Bus-Station: ")
- product = input("What product: ")
- quantity = float(input("Quantity: "))
- if place == "School":
- if product.lower() == "coffee":
- print(f"{(quantity * 0.50):.1f}")
- elif product.lower() == "water":
- print(f"{(quantity * 0.80):.1f}")
- elif product.lower() == "beer":
- print(f"{(quantity * 1.20):.1f}")
- elif product.lower() == "sweets":
- print(f"{(quantity * 1.45):.1f}")
- elif product.lower() == "peanuts":
- print(f"{(quantity * 1.60):.1f}")
- else:
- print("No such product")
- elif place == "Dormitory":
- if product.lower() == "coffee":
- print(f"{(quantity * 0.40):.1f}")
- elif product.lower() == "water":
- print(f"{(quantity * 0.70):.1f}")
- elif product.lower() == "beer":
- print(f"{(quantity * 1.15):.1f}")
- elif product.lower() == "sweets":
- print(f"{(quantity * 1.30):.1f}")
- elif product.lower() == "peanuts":
- print(f"{(quantity * 1.50):.1f}")
- else:
- print("No such product")
- elif place == "Bus-Station":
- if product.lower() == "coffee":
- print(f"{(quantity * 0.45):.1f}")
- elif product.lower() == "water":
- print(f"{(quantity * 0.70):.1f}")
- elif product.lower() == "beer":
- print(f"{(quantity * 1.10):.1f}")
- elif product.lower() == "sweets":
- print(f"{(quantity * 1.35):.1f}")
- elif product.lower() == "peanuts":
- print(f"{(quantity * 1.55):.1f}")
- else:
- print("No such product")
- else:
- print("No such place")
- #6
- num = int(input("Enter a number in range from -100 to 100: "))
- if -100 <= num <= 100 and num not in [-1, 0, 1]:
- print("Yes")
- else:
- print("No")
- #7
- hour = int(input("Enter the hour: "))
- day = input("Enter the day of the week: ")
- if day in ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]:
- if hour in [1, 2, 3, 4, 5, 6, 13, 14, 18, 19, 20, 21, 22, 23, 24]:
- print("closed")
- elif hour in [7, 8, 9, 10, 11, 12, 15, 16, 17]:
- print("open")
- elif day == "Sunday":
- print("closed")
- #8
- day = input("Enter the day for the ticket: ")
- if day == "Monday":
- print(12)
- elif day == "Tuesday":
- print(12)
- elif day == "Wednesday":
- print(14)
- elif day == "Thursday":
- print(14)
- elif day == "Friday":
- print(12)
- elif day == "Saturday":
- print(16)
- elif day == "Sunday":
- print(16)
- else:
- print("Unknown")
- #9
- food = input("Enter the food: ")
- if food in ["tomato", "cucumber", "pepper", "carrot",]:
- print("Vegetable")
- elif food in ["banana", "apple", "kiwi", "cherry", "lemon", "grapes"]:
- print("Fruit")
- else:
- print("Unknown")
- #10
- number = int(input("Enter the number: "))
- if number > 200 or number < 100 and number % 2 != 0:
- print("Invalid number")
- else:
- print()
- #11
- fruit = input("Enter the fruit you are going to buy: ")
- day = input("Enter the day: ")
- quantity = float(input("Enter the amount of fruits you are going to be buying: "))
- if day in ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]:
- if fruit == "banana":
- print(f"{(quantity * 2.50):.2f}")
- elif fruit == "apple":
- print(f"{(quantity * 1.20):.2f}")
- elif fruit == "orange":
- print(f"{(quantity * 0.85):.2f}")
- elif fruit == "grapefruit":
- print(f"{(quantity * 1.45):.2f}")
- elif fruit == "kiwi":
- print(f"{(quantity * 2.70):.2f}")
- elif fruit == "pineapple":
- print(f"{(quantity * 5.50):.2f}")
- elif fruit == "grapes":
- print(f"{(quantity * 3.85):.2f}")
- else:
- print("error")
- elif day in ["Saturday", "Sunday"]:
- if fruit == "banana":
- print(f"{(quantity * 2.70):.2f}")
- elif fruit == "apple":
- print(f"{(quantity * 1.25):.2f}")
- elif fruit == "orange":
- print(f"{(quantity * 0.90):.2f}")
- elif fruit == "grapefruit":
- print(f"{(quantity * 1.60):.2f}")
- elif fruit == "kiwi":
- print(f"{(quantity * 3.00):.2f}")
- elif fruit == "pineapple":
- print(f"{(quantity * 5.60):.2f}")
- elif fruit == "grapes":
- print(f"{(quantity * 4.20):.2f}")
- else:
- print("error")
- else:
- print("error")
- #12
- city = input("Enter the city: ")
- volume_sells = float(input("Enter the volume of sells: "))
- if city == "Sofia":
- if volume_sells >= 0 and volume_sells <= 500:
- print(f"{(volume_sells * 5 / 100):.2f}")
- elif volume_sells > 500 and volume_sells <= 1000:
- print(f"{(volume_sells * 7 / 100):.2f}")
- elif volume_sells > 1000 and volume_sells <= 10000:
- print(f"{(volume_sells * 8 / 100):.2f}")
- elif volume_sells > 10000:
- print(f"{(volume_sells * 12 / 100):.2f}")
- elif volume_sells < 0:
- print("Error")
- elif city == "Varna":
- if volume_sells >= 0 and volume_sells <= 500:
- print(f"{(volume_sells * 4.5 / 100):.2f}")
- elif volume_sells > 500 and volume_sells <= 1000:
- print(f"{(volume_sells * 7.5 / 100):.2f}")
- elif volume_sells > 1000 and volume_sells <= 10000:
- print(f"{(volume_sells * 10 / 100):.2f}")
- elif volume_sells > 10000:
- print(f"{(volume_sells * 13 / 100):.2f}")
- elif volume_sells < 0:
- print("Error")
- elif city == "Plovdiv":
- if volume_sells >= 0 and volume_sells <= 500:
- print(f"{(volume_sells * 5.5 / 100):.2f}")
- elif volume_sells > 500 and volume_sells <= 1000:
- print(f"{(volume_sells * 8 / 100):.2f}")
- elif volume_sells > 1000 and volume_sells <= 10000:
- print(f"{(volume_sells * 12 / 100):.2f}")
- elif volume_sells > 10000:
- print(f"{(volume_sells * 14.5 / 100):.2f}")
- elif volume_sells < 0:
- print("Error")
- else:
- print("Error")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement