[Solved] why does this second code not require split()? [closed]


when unpacking an iterable, the number of variables must match the values input being assigned. it depends on the values you are trying to unpack from the input.
for instance,

a,b= input() #12
print(a). #1
print(b). #2

You can easily unpack.
However if you pass in more values than variable you will get an error.

a,b= input() #123
print(a) #1
print(b) # error!!

To avoid that you can use the the ‘*’

a,*b= input() #1234567
print(a) #1
print(b) #[2,3,4,5,6,7]

0

solved why does this second code not require split()? [closed]