What is the input format? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the input format?

Hello, I am studying data science course in sololearn. But i have problem with first code project in this course. I have placed the default code below. My is here: We have a couple of lines of code. The first line contains 2 integer separated by space. What about the next lines? Should i write another input function? If not, how can I access the next lines? https://code.sololearn.com/cIu5VgADuaC8/?ref=app

31st Aug 2022, 10:32 AM
Mohammad Reza Moravejolahkami
Mohammad Reza Moravejolahkami - avatar
3 Answers
+ 3
You have assigned 2 values to 2 variables First check that it works n, p = [int(x) for x in input().split()] print(n) print(p) Now you can get on with the rest of your code
31st Aug 2022, 10:42 AM
Rik Wittkopp
Rik Wittkopp - avatar
0
Well you know, n and p are the number of row and column in the array. So the next n line(s) are the parameter of the array. I do not know whether i must define another input function for my project( if yes, to what extent? For each row I must define a input function?)? Or the array parameters are given in the first input function(if yes, how can i use them?)?
31st Aug 2022, 12:47 PM
Mohammad Reza Moravejolahkami
Mohammad Reza Moravejolahkami - avatar
0
You know, i do not the way sololearn compiler wants to do?
31st Aug 2022, 12:49 PM
Mohammad Reza Moravejolahkami
Mohammad Reza Moravejolahkami - avatar