-1

I currently use anaconda3. When I ran the code in anaconda below:

n, m = map(int, input('insert : ').split())

I wanted to see the result below

n, m = map(int, input('insert : ').split())

Then, I could put some datas next to the 'insert :' message.

However, I got this error code below instead of 'insert :' message.

ValueError: not enough values to unpack (expected 2, got 0)

How could I fix this problem?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
pineapple
  • 15
  • 3

1 Answers1

0

Where exactly are you placing your data?

You shouldn't place them like this:

n, m = map(int, input('insert : 31 41').split()) 

Otherwise it will give you the ValueError: not enough values to unpack (expected 2, got 0).

You need to run the code as it is:

n, m = map(int, input('insert :').split()) 

And on your console it will "ask" you to input your data like this:

input: <your value (n)>  <your value (m)>  

Make sure that when putting your values, leave a space in between the two values so Python can map the variables otherwise you'll get the same ValueError: not enough values to unpack (expected 2, got 0).

Nimantha
  • 6,405
  • 6
  • 28
  • 69
VintageMind
  • 65
  • 2
  • 9