# Have you wished that you could do get tasks done just by a click of button
# Well, not all tasks can be automated by a click, but there are definitely many that can be achieved by writing robust programs.
# Let us get some created.
'''Task 1: Product Inventory'''
print()
print("*** Task 1: ***")
print()
# You work in the inventory department of an Automobile company.
# You want to write a program that will help in:
# Taking the order quantity from the user and checking if there is enough stock of the item requested. [Hint: Set a value for the stock availability]
# If there is then take the name, address and phone number from the user and let them know it will be sent to their address in 48 hrs.
# If not let the user know that, the item is not in stock and that they will receive an email once it is in stock
# Ensure that the user enters the name, phone and address
print("Welcome to the Car Shipper. We will ship cars to you when you order them.\n")
car = int(input("We have these cars in our department:\n1- Mercedes Benz AVTR Vision\n2- Nissan Rogue 2024\n3- Volvo XC-40 2023\n4- Audi Q7 2026\n5- Geely Galaxy M7 2025\n6- BMW XM (performance SUV)"))
if car == 1:
quant=int(input("How many Mercedes Benz AVTR Vision cars would you like?\n"))
if quant > 64:
print("Sorry we don't have that many cars\n")
email = input("Please enter you email and we will email you when we have more cars in stock.\n")
else:
print(f"\nFortunately we have {quant} cars in stock. We will nw proceed to the payment.")
email = input("Please enter you email.\n")
price = int(input("How will you pay?\n1-cash\n2-card\n3-apple pay\n4-google pay"))
x = quant * 3000000
address = input("Please enter your address.")
print(f"Thank you for your payment, the total amount was {x}. The cars should arrive in 48 hours. If not, we will email you.")
elif car == 2:
quant=int(input("How many Nissan Rogue 2024 cars would you like?\n"))
if quant > 16:
print("Sorry we don't have that many cars\n")
email = input("Please enter you email and we will email you when we have more cars in stock.\n")
else:
print(f"\nFortunately we have {quant} cars in stock. We will nw proceed to the payment.")
email = input("Please enter you email.\n")
price = int(input("How will you pay?\n1-cash\n2-card\n3-apple pay\n4-google pay"))
x = quant * 25000
address = input("Please enter your address.")
print(f"Thank you for your payment, the total amount was {x}. The cars should arrive in 48 hours. If not, we will email you.")
elif car == 3:
quant=int(input("How many Volvo XC-40 2023 cars would you like?\n"))
if quant > 67:
print("Sorry we don't have that many cars\n")
email = input("Please enter you email and we will email you when we have more cars in stock.\n")
print(f"\nFortunately we have {quant} cars in stock. We will nw proceed to the payment.")
email = input("Please enter you email.\n")
price = int(input("How will you pay?\n1-cash\n2-card\n3-apple pay\n4-google pay"))
x = quant * 50000
address = input("Please enter your address.")
print(f"Thank you for your payment, the total amount was {x}. The cars should arrive in 48 hours. If not, we will email you.")
elif car == 4:
quant=int(input("How many Audi Q7 2026 cars would you like?\n"))
if quant > 96:
print("Sorry we don't have that many cars\n")
email = input("Please enter you email and we will email you when we have more cars in stock.\n")
else:
print(f"\nFortunately we have {quant} cars in stock. We will nw proceed to the payment.")
email = input("Please enter you email.\n")
price = int(input("How will you pay?\n1-cash\n2-card\n3-apple pay\n4-google pay"))
x = quant * 90000
address = input("Please enter your address.")
print(f"Thank you for your payment, the total amount was {x}. The cars should arrive in 48 hours. If not, we will email you.")
elif car == 5:
quant=int(input("How many Geely Galaxy M7 2025 cars would you like?\n"))
if quant > 142:
print("Sorry we don't have that many cars\n")
email = input("Please enter you email and we will email you when we have more cars in stock.\n")
else:
print(f"\nFortunately we have {quant} cars in stock. We will nw proceed to the payment.")
email = input("Please enter you email.\n")
price = int(input("How will you pay?\n1-cash\n2-card\n3-apple pay\n4-google pay"))
x = quant * 150000
address = input("Please enter your address.")
print(f"Thank you for your payment, the total amount was {x}. The cars should arrive in 48 hours. If not, we will email you.")
elif car == 6:
quant=int(input("How many BMW XM (performance SUV) cars would you like?\n"))
if quant > 12:
print("Sorry we don't have that many cars\n")
email = input("Please enter you email and we will email you when we have more cars in stock.\n")
else:
print(f"\nFortunately we have {quant} cars in stock. We will nw proceed to the payment.")
email = input("Please enter you email.\n")
price = int(input("How will you pay?\n1-cash\n2-card\n3-apple pay\n4-google pay"))
x = quant * 700000
address = input("Please enter your address.")
print(f"Thank you for your payment, the total amount was {x}. The cars should arrive in 48 hours. If not, we will email you.")
else:
print("Please enter a number above.")
'''Task 2: Publish Me'''
print()
print("*** Task 2: ***")
print()
# You are working in a publishing company and are incharge of checking if the articles submitted by the author are meeting the requirements.
# You need to create a program that will be your assistant and will:
# Check if they have provided their email address and phone number.
# If yes then, based on the word limit, you need to let the author know which category it would fall into.
# If words is greater than 35000, it would be published as a novel
# If words between 15000 and 35000, it would be published as an ebook
# If words between 2000 and 15000, it would be published as a blog post
# If words between 500 and 2000, it would be published as an FAQ entry
# Anything less than 500, rewrite
email = input("Please enter your email")
num = int(input("Please enter your phone number"))
count = int(input("Please enter your word count."))
if word>35000:
print("Your book will be published as a novel")
elif word>35000:
print("Your book will be published as a novel")
print("--- Publishing Assistant: Submission Validator ---")
email = input("Enter your email address: ")
phone = input("Enter your phone number: ")
if email == "" or phone == "":
print("Error: Please provide both email and phone number.")
else:
words = int(input("Enter the total word count: "))
elif words > 35000:
print("Category: Novel")
elif words >= 15000 and words <= 35000:
print("Category: Ebook")
elif words >= 2000 and words < 15000:
print("Category: Blog Post")
elif words >= 500 and words < 2000:
print("Category: FAQ Entry")
elif words < 500:
print("Status: Word count is too low. Please rewrite.")
else:
print("Please try again")
'''Task 3: Virtual Tour Guide'''
print()
print("*** Task 3: ***")
print()
# You have to write a program, which takes the following input from the user and displays the itinerary:
# Place - Dubai or Switzerland
# Days - 2 or 3
# Likes Adventure - Yes or No
# If the user specifies any other choice, display a message asking them to access their website.
# Take a look at details below and create your first virtual assistant program [Hint: Use multiple if statements]
# Dubai 2 Days Trip (Adventurous)
# Day 1: Skydiving over the Palm,Desert Safari
# Day 2: Hot air balloon flight
# Dubai 2 Days Trip (Not Adventurous)
# Day 1: Dubai Marina and Souk Visits
# Day 2: Dubai Museum, Dubai Fountain Show.
# Dubai 3 Days Trip (Adventurous)
# Day 1: Skydiving over the Palm, Desert Safari
# Day 2: Hot air balloon flight
# Day 3: Burj Khalifa , Dubai Mall
# Dubai 3 Days Trip (Not Adventurous)
# Day 1: Dubai Marina and Souk Visits
# Day 2: Dubai Museum, Dubai Fountain Show
# Day 3: Burj Khalifa , Dubai Mall
# Switzerland 2 Days Trip (Adventurous)
# Day 1: Rhine Falls
# Day 2: Mount Titlis
# Switzerland 2 Days Trip (Not Adventurous)
# Day 1: Glass Factory
# Day 2: Lauterbrunnen
# Switzerland 3 Days Trip (Adventurous)
# Day 1: Rhine Falls
# Day 2: Mount Titlis
# Day 3: Mount Jungfrau
# Switzerland 3 Days Trip (Not Adventurous)
# Day 1: Glass Factory
# Day 2: Trummelbach Falls
# Day 3: Interlaken
# Travel Virtual Assistant Program
print("--- Welcome to Your Travel Virtual Assistant ---")
place = input("Enter Place (Dubai or Switzerland): ")
days = input("Enter Days (2 or 3): ")
adventure = input("Likes Adventure (Yes or No): ")
if place == "Dubai":
if days == "2":
if adventure == "Yes":
print("\nYour Dubai 2-Day Adventurous Itinerary:")
print("Day 1: Skydiving over the Palm, Desert Safari")
print("Day 2: Hot air balloon flight")
elif adventure == "No":
print("\nYour Dubai 2-Day Relaxed Itinerary:")
print("Day 1: Dubai Marina and Souk Visits")
print("Day 2: Dubai Museum, Dubai Fountain Show")
else:
print("Invalid choice. Please access our website for more details.")
elif days == "3":
if adventure == "Yes":
print("\nYour Dubai 3-Day Adventurous Itinerary:")
print("Day 1: Skydiving over the Palm, Desert Safari")
print("Day 2: Hot air balloon flight")
print("Day 3: Burj Khalifa, Dubai Mall")
elif adventure == "No":
print("\nYour Dubai 3-Day Relaxed Itinerary:")
print("Day 1: Dubai Marina and Souk Visits")
print("Day 2: Dubai Museum, Dubai Fountain Show")
print("Day 3: Burj Khalifa, Dubai Mall")
else:
print("Invalid choice. Please access our website for more details.")
else:
print("Invalid number of days. Please access our website.")
elif place == "Switzerland":
if days == "2":
if adventure == "Yes":
print("\nYour Switzerland 2-Day Adventurous Itinerary:")
print("Day 1: Rhine Falls")
print("Day 2: Mount Titlis")
elif adventure == "No":
print("\nYour Switzerland 2-Day Relaxed Itinerary:")
print("Day 1: Glass Factory")
print("Day 2: Lauterbrunnen")
else:
print("Invalid choice. Please access our website for more details.")
elif days == "3":
if adventure == "Yes":
print("\nYour Switzerland 3-Day Adventurous Itinerary:")
print("Day 1: Rhine Falls")
print("Day 2: Mount Titlis")
print("Day 3: Mount Jungfrau")
elif adventure == "No":
print("\nYour Switzerland 3-Day Relaxed Itinerary:")
print("Day 1: Glass Factory")
print("Day 2: Trummelbach Falls")
print("Day 3: Interlaken")
else:
print("Invalid choice. Please access our website for more details.")
else:
print("Invalid number of days. Please access our website.")
else:
print("Sorry, we don't have information for that selection. Please access our website.")
To embed this project on your website, copy the following code and paste it into your website's HTML: