`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.")`
I need to make y = ax + b and i need to tell which are the points where the function is zero. My problem lies with the last two elif's. When i put a = 6 and b = -54 it calculates it as the last elif: (b/a) != 0 and type(b/a) !=int. While when you calculate -54/6 you become -9. It's as if the programe doesn't count negative numbers as integers. I'm working with dodona and I've noticed in the correction that the only that are false are the ones that classify as elif (b/Ba) != 0 and type(b/a) == int. I know that when you devide its automatically a float type. But i don't know any other option to seperate the two.
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.
[code]`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.")` [/code] I need to make y = ax + b and i need to tell which are the points where the function is zero. My problem lies with the last two elif's. When i put a = 6 and b = -54 it calculates it as the last elif: (b/a) != 0 and type(b/a) !=int. While when you calculate -54/6 you become -9. It's as if the programe doesn't count negative numbers as integers. I'm working with dodona and I've noticed in the correction that the only that are false are the ones that classify as elif (b/Ba) != 0 and type(b/a) == int. I know that when you devide its automatically a float type. But i don't know any other option to seperate the two. 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.
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...
когда я пытаюсь преобразовать это шестнадцатеричное число: 780000465257A7054F5180E46C000100004652 в десятичное число, оно должно дать мне следующее десятичное значение: 2676089517297180626710225817179225498977322578, p>
можешь попробовать используя...