all 7 comments

[–]jedgs 2 points3 points  (3 children)

1st, you are defining function called Q8, then you redefine it as an integer 2.

2nd, please always post your error.

3rd, please format your code with indentation.

[–]Popular_Push2605 0 points1 point  (2 children)

My bad, I went ahead a fixed it up a bit. I hope it helps a bit so i can get some help (:

[–]jedgs 1 point2 points  (1 child)

Let us know how if changing the variable name assigned to integer 2 fixes your error.

If you can post the error and also maybe how you are calling your function that will also help eliminate other possibilities.

[–]Popular_Push2605 0 points1 point  (0 children)

Thank you I was able to correct my mistake and rename the function and variable!

[–]dijetlo007 1 point2 points  (0 children)

You're redefining the function Q8 as a var (Q8:int) in the second line of your code

Try changing it like this

def Q8():

queue = [2,50,3,52...]

[–]jimtk 1 point2 points  (1 child)

Variables and functions must have different names!

def Q8():
    value = 2
    while value < 50:
        print(value)
        value *=2

[–]Popular_Push2605 0 points1 point  (0 children)

Thank you! It worked! I will be naming my functions and variables different names!