Код: Выделить всё
`a = int(input("Geef de a waarde van de vergelijking: "))
b = int(input("Geef de b waarde van de vergelijking: "))
if a == 0 and b != 0:
print("Er is geen gehele oplossing.")
elif a == 0 and b == 0:
print("Er zijn meerdere gehele oplossingen.")
elif a != 0 and b == 0:
print("De gehele oplossing is x = 0.")
elif (b/a) != 0 and type(b/a) == int:
print("De gehele oplossing is x = " + str(b/a) + ".")
elif (b/a) != 0 and type(b/a) != int:
print("Er is geen gehele oplossing.")`
P.S. the print from the last elif says "there are no integer results". the print form the elif before that says "the integer result is x = (b/a) ."
I have tried to do it with the float type but i don't know how to classify it as an integer when it's an float.
Источник: https://stackoverflow.com/questions/781 ... an-integer