Python Challenge 9 | Coding Challenges

preview_player
Показать описание
Python Challenge 9 | Coding Challenges #coding #challenge #python

Try to solve it in 15 mins!

-------------------------

--------------------------
Рекомендации по теме
Комментарии
Автор

The last...thanks continue creating content...

def main():

b_n = input('Enter some binary numbers, separated by commas: ')
b_n = b_n.replace(' ', '')
b_n_list = b_n.split(', ')
b_l = []
value = []
for b in b_n_list:
bn = '0b' + b
b_l.append(bn)
if int(bn, 2) % 5 == 0:
value.append(bn)
print(', '.join(value))


if __name__ == '__main__':
main()

TheBryanRedz