Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # def squ(x):
- # for i in range(1,x+1):
- # calc = 1 + (2*(i - 1))
- # print('*' * calc)
- # squ(4)
- # magic or normal
- number = ['100110100011100001', '10110', '11001001', '1001','1']
- def check_magic(i):
- inList = list(i)
- onecount = inList.count('1')
- zerocount = inList.count('0')
- if onecount > zerocount:
- print('normal')
- elif onecount == zerocount or onecount < zerocount:
- print('magic')
- for i in number:
- check_magic(i)
Advertisement
Add Comment
Please, Sign In to add comment