There are a few problems:
-
You haven’t initialized
global_var
. -
Also where is
local_var
defined? -
And you may want to use
,
instead of.
in your lastprint
statement.
Anyways, I don’t see where that SyntaxError
comes from.
More Related Contents:
- how to can i go over a file twice?
- Why doesn’t this python code run infinite times? [closed]
- What happens when start value < end value with range() cmd in Python?
- Getting the number value of characters in a word and to do arithmetic operations with the number for encoding [closed]
- Are list-comprehensions and functional functions faster than “for loops”?
- Append existing excel sheet with new dataframe using python pandas
- Is there a way in Pandas to use previous row value in dataframe.apply when previous value is also calculated in the apply?
- Is it possible to implement a Python for range loop without an iterator variable?
- How to change index of a for loop?
- How to loop through all but the last item of a list?
- How to access the previous/next element in a for loop?
- for loops and iterating through lists
- Get loop count inside a for-loop [duplicate]
- Changing variable names with Python for loops [duplicate]
- “for loop” with two variables? [duplicate]
- How does the Python’s range function work?
- Are infinite for loops possible in Python? [duplicate]
- Why does this python dictionary get created out of order using setdefault()?
- Why does a for-loop with pop-method (or del statement) not iterate over all list elements [duplicate]
- How to slice a generator object or iterator?
- Check presence of vowels in a string
- Is it possible to make a `for` loop without an iterator variable? (How can I make make code loop a set number of times?)
- How can I make sense of the `else` clause of Python loops?
- Reverse a string without using reversed() or [::-1]?
- How to get the previous element when using a for loop? [duplicate]
- Converting List Comprehensions to For Loops in Python
- Skip over a value in the range function in python
- Using a loop in Python to name variables [duplicate]
- How does the Python for loop actually work?
- Skipping every other element after the first [duplicate]