Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- #This program converts a user's name into a binary
- #representation. Example:
- #Тарас → '1000010001010000110000100010000001000011000010001000001'
- name_string = input("Hello, what is your name?\n > ")
- name_binary = ''.join(format(ord(letter), 'b') for letter in name_string)
- print(f"Your name in binary representation: {name_binary}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement