Thanks! This works and it only takes up 4 lines of code. The computation time is also much faster than my code. I think that I understand why it works faster as well. Your code executes after looping 23 times. However, my code executes after 11 iterations of 23 or 253 iterations which is 11 times more than my code. Also, it took 13.7 milliseconds, whereas as mine took 185 milliseconds which is 13.5 times as fast. I suspect that the method that I used where I changed my list into a set and then returned to transform it into a list also took more time than your method you recommended to me, which could partially explain the discrepancy in computation time as well.
input() takes a string to display and the it is up to the user to enter a value. As long as the input is a valid int you should be safe to convert the input to int
To print a variable value you just need to use the literal without quotes.
Here is a slightly modified version of your code that should work.
svar = input('Enter a number')
y = x * x
...inactive cell. If both the neighbours are either active or inactive, the cell becomes inactive the next day, otherwise it becomes active on the next day. ...
So everything gets turned to 1 except when both neighbor cells (to the left and right of the cell) are the same. So if both neighbor cells are either 0' or 1's the cell becomes 0. The VERY first and VERY last cell have an invisible neighbor to left and right respectively with a value of 0 that doesn't change.
Let's use a 3 cell model instead of an 8 cell model.
0, 1, 0
After Day 1:
1, 0, 1
After Day 2:
0, 0, 1
Note: 0, 1, 0 have two invisible cell values that do not change values e.g. (0), 0, 1, 0 , (0)