Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set0 #4

Open
rohit20032003 opened this issue Jun 28, 2024 · 1 comment
Open

set0 #4

rohit20032003 opened this issue Jun 28, 2024 · 1 comment

Comments

@rohit20032003
Copy link

rohit20032003 commented Jun 28, 2024

indoor

indoor.py

correct codes
def main():
user_input = input("Please enter some text: ")
print(user_input.lower())

if name == "main":
main()

tip
def main():
dollars = dollars_to_float(input("How much was the meal? "))
percent = percent_to_float(input("What percentage would you like to tip? "))
tip = dollars * percent
print(f"Leave ${tip:.2f}")

def dollars_to_float(d):
# Remove the leading $ and convert to float
return float(d.replace("$", ""))

def percent_to_float(p):
# Remove the trailing % and convert to float, then divide by 100 to get the decimal value
return float(p.replace("%", "")) / 100

main()

@aviiciii
Copy link
Owner

hi @rohit20032003 have the assignments changed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants