Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Created by GitHackTools
- # Twitter @SecureGF
- # Google+: google.com/+TVT618
- # Fb: fb.com/GitHackTools
- def testdivide():
- try:
- n1 = float(input('Enter divide number: '))
- n2 = float(input('Enter number to divide: '))
- if n1 % n2 == 0:
- return ('{} can divide for {}'.format(n1,n2))
- elif n1 % n2 != 0:
- return ('{} can not divide for {}'.format(n1,n2))
- except ValueError:
- return('Must be a number, not a words or empty!')
- except ZeroDivisionError:
- return('The number to divide cannot be 0!')
- def listdivide():
- try:
- can = []
- n3 = int(input('Enter the start number of array: '))
- n4 = int(input('Enter the end number of array: '))
- n5 = int(input('Enter the number to divide: '))
- for i in range(n3,n4+1):
- if i % n5 == 0:
- can.append(i)
- print()
- print('The numbers can divide for {} from {} to {} is:'.format(n5,n3,n4))
- return can
- except ValueError:
- return('Must be a number, not a words and decimals, or empty!')
- except ZeroDivisionError:
- return('The number to divide cannot be 0!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement