I want to take 2 inputs. why error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

I want to take 2 inputs. why error

https://code.sololearn.com/cBBLuy43t7O4/?ref=app

27th Feb 2021, 3:19 PM
Perplexed Coder
Perplexed Coder - avatar
7 Answers
+ 5
Your code requires 3 inputs, not 2 And you can't run codes that requires interactive input in Code Playground.
27th Feb 2021, 3:25 PM
Ipang
+ 3
Ok sorry I misunderstood what you mean. First thing, indent line 11 And give the input on separate line e.g. 3 2 3 4 5 6 7 Try it and tell me how it goes ...
27th Feb 2021, 4:26 PM
Ipang
+ 1
to get inputs as: 3 2 3 4 5 6 7 ie: row_count row_first ... row_last you could do: n = int(input()) list2d = [ map(int,input().split()) for i in range(n) ] print(list2d)
27th Feb 2021, 5:26 PM
visph
visph - avatar
0
No bro
27th Feb 2021, 4:20 PM
Perplexed Coder
Perplexed Coder - avatar
0
Like 3 2 3 4 5 6 7
27th Feb 2021, 4:20 PM
Perplexed Coder
Perplexed Coder - avatar
0
Are the test cases
27th Feb 2021, 4:20 PM
Perplexed Coder
Perplexed Coder - avatar
0
It's an infinite loop asking for input. Just added break. t=int(input()) while t: n=int(input()) k=int(input()) if n<k: print(n) break else: for i in range(n): n=n-k print(n) break t-=1
27th Feb 2021, 5:08 PM
Zheko V. Ginev
Zheko V. Ginev - avatar