Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def strtolist(string) :
- lista = []
- while True:
- x = string.find(',')
- if x == -1:
- num = string
- lista.append(int(num))
- break
- num = string[0:x]
- lista.append(int(num))
- string = string[:0] + string[x+1:]
- return lista
- def edivisor(num1,num2) :
- if (listanum[0]%listanum[1]) == 0 :
- return True
- else :
- return False
- num = input("Digite os dois numeros (separados por ,) para verificar se sao divisores: ")
- listanum = strtolist(num)
- print("É divisor? %s" % edivisor(listanum[0],listanum[1]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement