[Tutor] [maryknauth at mac.com: Re: Input parameters for functions]

David Rock david at graniteweb.com
Sat Jun 20 15:24:17 EDT 2020


* Alan Gauld via Tutor <tutor at python.org> [2020-06-20 18:57]:
> On 20/06/2020 18:22, Mary Knauth via Tutor wrote:
> 
> account_balance = 500.00
> amount = float(input("How much to deposit?"))
> account_balance = deposit(account_balance, amount)  # assign new balance
> print(account_balance)                 # should now be 500+amount

To stick with the functions you have already written, print(account_balance)
could (should?) be replaced by balance(account_balance)

As mentioned by others, the naming of that function is a little clunky.
Changing to print_balance() would be a little clearer what it actually
does (and explains why you would use it rather than just a simple print
statement).

-- 
David Rock
david at graniteweb.com


More information about the Tutor mailing list