Nov-14-2023, 06:40 PM
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]