bytes_to_word.py

Created by wperez274

Created on August 20, 2022

772 Bytes


from math import *
from random import *
from ion import *
from time import *

"""
0=00000000
1=00000001
2=00000010
3=00000011
4=00000100
5=00000101
6=00000110
7=00000111
8=00001000
9=00001001

BINARY GUIDE

00000111 =1+2+4 = 7 = 0b111
00001111 =1+2+4+8 = 15 = 0b1111
00011111 =1+2+4+8+16 = 31 = 0b11111
11111111 =1+2+4+8+16+32+64+128 = 0b11111111


"""

#bit=1
#byte=bit*8
#kb=byte*10**3
#mb=byte*10**6


# +1 for a space for word
average_word=5+1

while not keydown(KEY_BACK):
  mem=input("""\nEnter amount of bytes.
  Be careful not to enter
  Kilobytes.
  Note: 1 kilobyte = 1000 Bytes.

: """)
  calc=int(mem)
  print("-----------------------------\n",mem,"bytes \n\n= Approx:",round(calc/average_word)," Words.\n-----------------------------")

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.