Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ''' Question 11
- Write a program which accepts a sequence of comma separated 4 digit binary numbers as its input and then check whether they are divisible by 5 or not. The numbers that are divisible by 5 are to be printed in a comma separated sequence.
- Example:
- 0100,0011,1010,1001
- Then the output should be:
- 1010 '''
- inputStr = input().split(",")
- for var in inputStr:
- variable_int = int(var, 2)
- if variable_int % 5 == 0:
- print(var)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement