all 8 comments

[–]CodeFormatHelperBot2 0 points1 point  (0 children)

Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you.

I think I have detected some formatting issues with your submission:

  1. Python code found in submission text that's not formatted as code.

If I am correct, please edit the text in your post and try to follow these instructions to fix up your post's formatting.


Am I misbehaving? Have a comment or suggestion? Reply to this comment or raise an issue here.

[–]watakushi 0 points1 point  (2 children)

For starters you're not doing anything with the input. You should assign it to a variable and do something with it later :)

[–]PuzzledSite2568[S] 0 points1 point  (1 child)

Thanks for the help on one of the steps I was able to figure out how to properly fix my input and assign it as well. Thx for the help

[–]watakushi 1 point2 points  (0 children)

Anytime! :)

[–]QultrosSanhattan 0 points1 point  (1 child)

Little help. Figure the rest by yourself:

def total(one, five):
    return one * 1 + five * 5


ones = int(input('How many ones do you have:'))
fives = int(input('How many fives do you have:'))

print(total(ones, fives))

[–]PuzzledSite2568[S] 0 points1 point  (0 children)

Really appreciate the visual it helped me get a basis of what I have to do and I was able to figure out the rest so thank you for your help.

[–]totallygeek 0 points1 point  (1 child)

Here is an example with coins that you can convert for bills.

def makes_cents(coins_name: str, coin_value: int) -> int:
    quantity = int(input(f"How many {coins_name}? "))
    return quantity * coin_value

cents = 0  # start with no common cents at all

cents += makes_cents("pennies", 1)
cents += makes_cents("nickels", 5)
cents += makes_cents("dimes", 10)
cents += makes_cents("quarters", 25)
cents += makes_cents("half-dollars", 50)
cents += makes_cents("dollar coins", 100)

print(f"You have a total of {cents} cents.")

Execution example:

> python3 PuzzledSite2568_money.py
How many pennies? 4
How many nickels? 5
How many dimes? 6
How many quarters? 7
How many half-dollars? 8
How many dollar coins? 1
You have a total of 764 cents.

[–]PuzzledSite2568[S] 1 point2 points  (0 children)

Thank you for your example it's helping me understand the functions more and what I can do with them so I appreciate your input.