Skip to content
Advertisement

Tag: integer

int unexpectedly turning into string

With the following snippet from a script: I expected the outcome to be: but instead I get: Does anyone know why this is happening and how I can fix it? In case you need it here is SelectTile: Answer You are not assigning the new int value to the original variable. Here’s a fix:

limited input numbers and save a list into a list

user input example split using ” ” the space between them and turn them to inteager the and should be = but after spliting and converting each number should be < 10 and >= 0 and save it to be the i need to input the line 9 times not once and been duplicate Answer Here’s the code updated for

Operand error when using an integer in a list

I’ve been trying to work on this code for hours but keep getting to the same point every time. Basically I’m trying to add up all the values in an array. However, it keeps saying unsupported operand for integer and list. I’m confused why it is saying that because the list consists of integers. This is in python. Above is

How do I convert a list of strings to integers in Python [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 1 year ago. Improve this question I need help on how to convert a list to integers, for example

Advertisement