How to take two separate inputs in Python using a single line of code, but treating them as if entered on two separate lines?
n, m = int(input()), input().split()
In this code:
ntakes the first input as an integer (int(input())).mtakes the second input as a space-separated list of strings (input().split()), where thesplit()method splits the input into individual components based on spaces.
Even though both inputs are on the same line of code, this effectively simulates two separate inputs, as m is treated as a list (from the space-separated input) and n as an integer.
Alternatively, the code could be split into two lines as:
n = int(input())
m = input().split()
Here, n is assigned the integer value from the first input, and m is assigned the space-separated values from the second input, treated as a list of strings.
How to consider the non-negative number?
If element or number is greater than or equal to zero that means its non-negative
cause reale number
num <=05<=0
e.g. 4 is bigger than 0
4,5,8,9, all whole and real number if bigger than the 0
