try:
target = int(input("Please enter the ammount you are looking for :"))
except ValueError:
print("wrong value please enter a number")
target = int(input("Please enter the ammount you are looking for :"))
found = False
location = [] # I want to use this list as position argument for another array passed from another function. is it possible?
for pos in range(0, len(wydatki)):
if wydatki[pos] == target:
found=True
location.append(pos)
if found==True:
#prints the locations in the list that the target was found
print (target,"\nappears in the following locations: ",months[location])
else:
print (target,"\nwas not found in the list.")
months[location] <------ I would like to use list called location that holds more than one variable to print onto screen values assigned to positions in list called months is it possible?
As normally you can only use single variable to point to position in array?