-
Notifications
You must be signed in to change notification settings - Fork 79
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
Calculator test #175
base: main
Are you sure you want to change the base?
Calculator test #175
Conversation
Hai inviato un file vuoto. Controlla che il file aggiunto venga effettivamente "tracciato" con |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il file è vuoto
def mul(a: int, b: int)-> int: | ||
return a*b | ||
|
||
def div(a: int, b:int)-> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mi sembra tutto ok, una piccola nota è che potresti aggiungere in questa funzione un controllo per assicurarti che b non sia zero e in quel caso ritornare magari None :)
def mul(a: int, b: int)-> int: | ||
return a*b | ||
|
||
def div(a: int, b:int)-> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il return type è errato.
if b==0: print("The division is not possible") | ||
else: | ||
dv= div(a,b) | ||
print(f"The division is {dv} ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il controllo se il secondo termine è 0 devi farlo dentro la funzione div
, così facendo puoi scrivere un test che verifichi pure quello scenario.
No description provided.