I am trying to input a number, and will create x amount of declared empty lists.
Ex: Input number >> 3
Result:
1 = []
2 = []
3 = []
So I am thinking convert the input str into int, then insert the int value into range (x). Then do a loop that can create x amount of number with '= []'. In my final work, I would want to take out the data stored in these list into different fields.
Below is code:
number = input("Input number")
number = int(number)
x = range (number)
for y in x.attributes:
str(y) = []
#a loop that insert values in list into fields
driver.find_element_by_name('Name').send_keys(1[0])
driver.find_element_by_name('GRADE').send_keys(1[1])
driver.find_element_by_name('DATE').send_keys(1[2])
Error msg:
str(y) = []
^
SyntaxError: cannot assign to function call
I think declared value should str, so I have str(y) there.
Appreciate the help with some short explain or what kind of guide i should look for. Thanks