I want a percentage sign to display after the users enters their number. Thanks
percent_tip = float(input(" Please Enter the percent of the tip:")("%"))
For example, before the user types anything they should see:
Please Enter the percent of the tip:
Once they begin typing the number 20
they should see:
Please Enter the percent of the tip: 20
After they hit <Enter>
they should see:
Please Enter the percent of the tip: 20%
Please try this if this is what you are asking for:
import sys
import timepercent_tip = ""while percent_tip in "123456789": # This part checks with the "if" statement, if its not a integer then it returnspercent_tip = input("Please Enter the % of the tip: ")if percent_tip in "123456789":print(str(percent_tip) + " %") # Prints the number and the percentage symbolsys.exit() #stops the shellelse:time.sleep(.100) #Shell waits then goes back in the while loop (unless its controlled by the "while" and "if")
Please do not try to harden yourself with a code that you don't know how to do it.