0

Redefining variables in a list or with input in python

So let’s say I define a variable.# x = 1 y = 0 I want to redefine these with user input# x = input(“input a value”) I have them in a list.# mylist = [x, y] So now can I redefine these variables using user input? set all variables in the list to equal one? None of this is working. Where has my understanding fallen down?

30th Dec 2017, 12:28 PM
Sebastian Kerr
Sebastian Kerr - avatar
1 Answer
0
What do you mean, exactly? Is it to redefine the list or the variables to change the list. i think this is what you mean (check out the link to see if i got it right) https://code.sololearn.com/ctlUnffuh5Zd/#py Beside, I think the comments are the thing that have thrown you some errors. It should be like ‘#comment’ Hopes that should be able to help you😉
30th Dec 2017, 3:46 PM
monotom
monotom - avatar