frommathimport*fromrandomimport*fromkandinskyimport*fromionimport*fromtimeimport*fill_rect(0,0,322,222,"black")draw_string("""
There are only 10 kinds
of people in this world:
Those who understand binary,
and those who don't.
Which one will you become?
""",20,40,choice(["white","orange","cyan"]),"black")sleep(0.2)whilenotkeydown(KEY_OK)andnotkeydown(KEY_EXE):draw_string("Press OK to Begin",115,200,"white","black")restart=Trueloop=Truefont=choice(["green","white","gray","cyan"])fill_rect(0,0,322,222,"black")whileloop:fill_rect(0,20,322,2,"gray")fill_rect(0,55,322,2,"gray")mylist=[]forninrange(40,40+12*9,14):sleep(0.1)bit=choice([0,1])draw_string(str(bit),n,30,font,"black")mylist.append(bit)decimal=mylist[-1]*1+mylist[-2]*2+mylist[-3]*4+mylist[-4]*8+mylist[-5]*16+mylist[-6]*32+mylist[-7]*64+mylist[-8]*128whilenotkeydown(KEY_OK):draw_string(str(mylist),30,90,"gray","black")draw_string(str("= "+str(decimal)),165,30,"white","black")draw_string("Standard Format: "+str(bin(decimal)),25,130,"white",(15,25,45))ifint(decimal)%2==1:draw_string("Number: Odd ",32,160,"gray","black")else:draw_string("Number: Even",32,160,"green","black")draw_string("Press OK to restart",115,200,"cyan","black")font=choice(["cyan","green","white","gray"])fill_rect(0,0,322,222,"black")
During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:
Ensure the proper functioning of the site (essential cookies); and
Track your browsing to send you personalized communications if you have created a professional account on the site and can be contacted (audience measurement cookies).
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.