Start a new topic

Stuck on code in Ceed Universe

I just don't understand how to do this, any help? import math """Finish the function pi_approx which accepts a float n as an input.The function should sum n reciprocal-squares i.e 1/(1**2) + 1/(2**2) + ... + 1/(n**2). Then your function should multiply this result by six and square root it. math.sqrt(x) returns the square root of x """ Thanks

To complete this function, you'll have to make sure your function accepts a float. 

Use typecasting for the variables. You can use for example:

float(a)

int(number)


example:

for a in range(1, int(number)+1):


I hope this will help.

Thanks! Managed to work it out :)

On one of the unlock door things in "CEED-Universe" it says 

if a_bool:


# if what follows an 'if' evaluates to True, the indented code below will run

    key.move ('up')

but when I type in 


if a_bool == True


it gives me a syntax error pointing at the e in true,


Please tell me what I am doing wrong.

Did you put a colon after True? Like if a_bool == True:
Did you put a colon (:) after True?
Login or Signup to post a comment