I need to access two local arrays to put into a function that calculates based off of them.
The array and variable are:
import random
code=[random.randint(1,9), random.randint(0,9), random.randint(0,9), random.randint(0,9)]
guess=int(input())
The sub-routine is:
def main():
#creating a function
answers = [3, 3, 4, 4]
guesses = [3, 5, 6, 4]
answers_counter = Counter(answers)
guesses_counter = Counter(guesses)
The arrays answers and guesses needs to be the first 4 digits in guess and code. How do I access these without getting an error?
What I have tried:
I tried calling the variables and also using global