seniornames =[]
paidornot =[]
for i in range("senior"):
print("Please enter the name of the Senior Citizen", i+1);
seniornames.append (input())
print(seniornames)
there is an error saying - File "/Users/rheasethi/Documents/Task 2 pre release.py", line 37, in for i in range("senior"): TypeError: 'str' object cannot be interpreted as an integer
What should I do?
range("senior")to do?rangetakes an integer and returns a range up to that integer.range(5)being0, 1, 2, 3, 4,range("senior")is…? (If you have a variable calledseniorand would like to pass it instead of a string, that’srange(senior), but that information isn’t in your question so it’s just a guess.) - Ry-♦