Imagine you are running a fundraiser, users will enter their name
and donation
in dollars into your program. If the name is invalid (empty string), print Invalid name
. If the user entered their name but did not make a donation, print Donation required
. Otherwise, print “Thank you name
for your $donation
donation!”
Hint: You will need a separate if
statement to check each of three conditions
*** The name is not empty and the donation is not zero (name and donation
)**
*** The name is not empty but the donation is zero**
*** The name is empty**
The paragraph in bold is a question I’ve recently encountered and I’m confused
name = input("Enter your name: ")
if name: print("Please enter your donation: ")
if not name: print(“Invalid name, kindly enter your name”)
donation = 1 > 0
** if donation < 0:**
** print(“Donation required”)**
** if 1 > 0:**
** print(" Thank you" name “for your $”**
** donation “donation”)**
This is what I put as my solution and it keeps on showing that I have a syntax error in line 5. What am I doing wrong?