Vinayagar Chaturthi Special
Practice Python to improve your coding skills. Use VS Code and create the files below. Run each program and check the output.
Calculate the total prasadam (modaks and bananas), check if the quantity is sufficient for all the guests, and display the prasadam details with Vinayagar Chaturthi greetings.
To calculate the total prasadam (modaks and bananas), check if the quantity is sufficient for all the guests, and display the prasadam details with Vinayagar Chaturthi greetings.
input() and int() to store these values in variables.guests * 2if-else to compare total prasadam with needed prasadam.# Vinayagar Chaturthi Prasadam Counter
# Step 1: Get inputs
guests = int(input("How many guests are coming? "))
modaks = int(input("How many modaks do you have? "))
bananas = int(input("How many bananas do you have? "))
# Step 2: Calculate total prasadam
total_prasadam = modaks + bananas
print("Total prasadam items:", total_prasadam)
# Step 3: Check prasadam needed
needed = guests * 2
print("Total prasadam needed:", needed)
if total_prasadam >= needed:
print("Enough prasadam for everyone!")
else:
print("Not enough prasadam, please prepare more.")
# Step 4: Extra Check
if total_prasadam > 50:
print("Wow! You have a grand prasadam feast for Vinayagar Chaturthi!")
Post in the group with any of these problems:
Good luck and have fun coding!