Words to Binary convertor.

                        Welcome Words to Binary convertor


                                           This is all words convert to Binary.



while True:
print("Welcome to the Binary Converter!")
print("1. If you are intrested")
print("2. Exit")
choice = input("Enter your choice (1/2): ")

if choice == '1':
# Convert a paragraph to binary
print("Enter your words:")
paragraph = ""
while True:
line = input()
if line:
paragraph += line + "\n"
else:
break
byte_value = paragraph.encode("utf-8")
binary_value = bin(int.from_bytes(byte_value, byteorder="big"))[2:]
print("😇 Your Binary value is = ", binary_value, "\n")
elif choice == '2':
print("Koi Baat Nahi 😞")
break
else:
print("Invalid choice! Please enter 1, 2.")
print("\n\n 😇😇😇 Your task complete")

Comments

Popular posts from this blog

Binary to Number converter.

Python Tkinter QR Code Generator

color guessing game with GUI using python