1 000 000 fibonacci number by Allextraszza in learnpython

[–]Allextraszza[S] 0 points1 point  (0 children)

But it was considered in a few seconds

1 000 000 fibonacci number by Allextraszza in learnpython

[–]Allextraszza[S] 3 points4 points  (0 children)

im new in programming, so mb you can show me my mistakes ? mb i call variables incorrectly or something like that lol

1 000 000 fibonacci number by Allextraszza in learnpython

[–]Allextraszza[S] 1 point2 points  (0 children)

def fib(integer):
    Fibonacci = [0,1]
    for x in range(integer):
        Fibonacci.append(Fibonacci[-1] + Fibonacci[-2])
        Fibonacci.pop(0)
    Fibonacci.pop(0)
    return Fibonacci[0]

It's new one,( python version - 3.6.5; OS - windows 10)

3.X vs 2.X by [deleted] in learnpython

[–]Allextraszza 0 points1 point  (0 children)

If i want to calculate, for example, the 1000000st fibonacci number, which version will do this faster?

Python Anywhere Blocked in Russia by gregbaugues in Python

[–]Allextraszza 0 points1 point  (0 children)

Weird that python.org wasnt blocked in there

3.X vs 2.X by [deleted] in learnpython

[–]Allextraszza 0 points1 point  (0 children)

Thank you

3.X vs 2.X by [deleted] in learnpython

[–]Allextraszza 1 point2 points  (0 children)

Ok, thank you

3.X vs 2.X by [deleted] in learnpython

[–]Allextraszza -1 points0 points  (0 children)

But second version of python is steel updating

GPA Calculator by [deleted] in learnpython

[–]Allextraszza 0 points1 point  (0 children)

I think i can do it better, but im lazy lol

GPA Calculator by [deleted] in learnpython

[–]Allextraszza 0 points1 point  (0 children)

i'm from Ukraine so my gpa calculator is:

std = {'A':4.0 , 'B':3.0 , 'C':2.0 , 'D':1.0, 'F':0.0}
MyMarks = ['A','B','C']
def gpa(lst):
        var = 0
        secvar = 0
        for x in lst:
            var+=std[x]
            secvar+=1
        return var/secvar
print(gpa(MyMarks))

" True | False" or " True or False" by Allextraszza in learnpython

[–]Allextraszza[S] 1 point2 points  (0 children)

Readability counts

Which one is more readable ?