def part1():
with open("test.txt") as file:
data = csv.reader(file, delimiter=',')
for row in data:
a = row[0]
b = row[1]
c = row[2]
d = row[3]
e = row[4]
f = row[5]
def printing():
print (a)
So I just want to use the variables from "part1" in "printing". I have tried stating that each variable in part1 as "global repetitive and I feel like there's a much more efficient way to achieve this.
Any help would be appreciated. (and please don't judge my code, it's just an example)