Ok, first of all, I'm a total newb in python. So, what I'm trying to achieve is creating a list of lists, in which first element is a string and second is an integer. First, I enter a number of sets and then every set on a new line, so it looks like this:
3
Alex 40
Boris 30
Claire 50
This seems to be working
n = int(input())
nums = []
for i in range(n):
num = input().split()
num[1] = int(num[1])
nums.append(num)
But I've been trying to improve this method:
n = int(input())
nums = []
for i in range(n):
nums.append([[x, int(y)] for x, y in input().split()])
Which in return gives me "ValueError: too many values to unpack (expected 2)"