Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite0
Define a function called "Division" with two parameters and return type float, which divides the first parameter with the second
parameters
2 Réponses
+ 1
You know what is a function? Know how define it?
+ 1
With Python:
# function
def Division(a, b):
if b == 0:
return "division by Zero error"
return a / b
# tests
y = Division(1, 7)
print(y)
print(Division(6, 4))
print(Division(6, 0))
print(Division(0, 4))