Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,814 members, 7,820,876 topics. Date: Wednesday, 08 May 2024 at 12:13 AM

Simple Python Challenge - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Simple Python Challenge (1125 Views)

Practical Introduction To Python Web Programming / Python Smtp Scanner / Mastering Python - Networking And Security Training Video (2) (3) (4)

(1) (Reply) (Go Down)

Simple Python Challenge by Slyr0x: 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: 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)

Affordable Android App Development For Wordpress News Website / Has Ecobank Called Anyone For The Post Software Development Interview? / A Simple Traffic Light Circuit

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 16
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.