Nov-14-2023, 06:40 PM
(This post was last modified: Nov-14-2023, 07:10 PM by deanhystad.)
Hi, I'm a complete beginner
I try two versions and sending warnings. What is the problem?
1.
I try two versions and sending warnings. What is the problem?
1.
# 1USD= 0,8 Eur def usd_to_eur(usd: int, euro: int) -> float: return usd * euro print(usd_to_eur(5,0.8))
Error:Warning: Argument 2 to "usd_to_eur" has incompatible type "float"; expected "int" [arg-type]
2.def usd_to_eur(usd: int) -> int: return usd * 0.8 print(int(usd_to_eur(80)))
Error:Warning: Incompatible return value type (got "float", expected "int") [return-value]
deanhystad write Nov-14-2023, 07:10 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.