Syntax

python

#1

Hey guys, anyone know what is happening, please give me some advice

-Thank you so much-


#2

Calling a function before it is defined. Switch the two functions around so that main() follows get_name()/


#3

Oh. I see. Thank you so much for your help!


#4

Thank you so much again for your help! I have one more problem, do not know how to fix.


#5

Again, there are functions being called before they are defined. But there is also a problem with the variables not existing in global scope.

def compare():
    if LA() > SF():
        #...

should work. I’m pretty sure that Python does not ‘hoist’ the way JS does so order of definitions is important. We should not be calling a function from above its definition.


#6

Thank you so much for your reply!


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.