₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,012 members, 8,419,928 topics. Date: Thursday, 04 June 2026 at 07:40 AM

Toggle theme

Simple Python Challenge - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingSimple Python Challenge (1270 Views)

1 Reply (Go Down)

Simple Python Challenge by Slyr0x(op): 3:57pm On May 15, 2016
Hey guys,

Another challenge.

Question : Tope wrote a computer program. He isn't a very good programmer, so his program takes too long. Can you figure out the output?


import struct
import ctypes
import cmath

offset = struct.calcsize('PP')
def set(x, i):
ctypes.c_ssize_t.from_address(id(x) + offset).value = i


def get(x):
return x ^ 0


set(1, 23)
set(2, (lambda x:x + 1)(1))
set(3, 59)
set(4, 134)
v = hash(open(__file__).read()[-587:]) + 93607936174329872951
set(5, -287)
j = 12219
n = 12
dsdaasdkjdsf = (v*v*v*v*v )**0.5
while n < dsdaasdkjdsf + 10:
set(1, get(3) - get(4) + get(5) + get(5) + get(5) + get(5) + get(5) + get(2))
set(2, -get(3)-get(3) + get(4) + get(4) + get(4) - get(5) - get(5) - get(5) - get(5) - get(5) - get(5) - get(2) - get(2) - get(2) - get(2) - get(2) - get(2) - get(2))
set(3, get(1) + get(1) + get(3))
set(4, get(1) + get(2) + get(3) + get(5))
set(5, -get(4) -get(4) -get(4)+ get(1) + get(1) + get(1) + get(1) + get(1))
n -= int((2.7182818 ** (3.14159265j)).real - 0.2)
print get(5) % 10**100
Re: Simple Python Challenge by Nobody: 6:00pm On May 15, 2016
I don't know python I don't think anyone will be interested in this Greek mathematics and the program is poorly written . I tried to run the Greek program since I can't do shit . grin


my guess ans is 0.25
Re: Simple Python Challenge by Slyr0x(op): 8:45pm On May 15, 2016
proxy20:
I don't know python I don't think anyone will be interested in this Greek mathematics and the program is poorly written . I tried to run the Greek program since I can't do shit . grin


my guess ans is 0.25
Wrong.
Re: Simple Python Challenge by Nobody: 8:52pm On May 15, 2016
so confusing what is **
Re: Simple Python Challenge by sleepingdemon: 9:16pm On May 15, 2016
proxy20:
so confusing what is **
that's raised to the power of, same thing ^ is used for in some other languages
1 Reply

Practical Introduction To Python Web ProgrammingPython Smtp ScannerMastering Python - Networking And Security Training Video234

Fastest Website Design & Software Development In Nigeria At An Affordable PriceMust Open:android Mobile Applications DeveloperResearchers Working On Program To Bring The Dead Back To Life