mercredi 10 juin 2020

in this python script why isnt it subtracting like it suppose to?

forum, I was just doing this for giggles to see how much I had learned and I came across an issue...below is what I have written, why isn't it subtracting as its suppose to, is there something that I should take into consideration?

numbers = input("what number would you like to calculate? ")

print(numbers)
first = numbers[0]
second = numbers[1]
third = numbers[2]
for i in range(1,10):
    z = int(third) + (i * 3)
    if z >= 10:
        z = z - 10
    y = int(second) + (i * 2)
    if y >= 10:
        y = y - 10
    x = int(first) + (i * 1)
    if x >= 10:
        x = x - 10    
    print(x, y, z)
    i += 1

any input on this issue would be appreciated, thanks for your time.

Aucun commentaire:

Enregistrer un commentaire