We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Hi,
Can I please ask someone to explain the input to me on HackerRank?
Why is that if I try:
print(input.split(" "))
I just get a 10, while I expect a list numbers in str format. But if I try
print(list(map(int, input().split(" ")))
I get a list?
I have even tried to just print the input:
s = input()
print(s)
but I only a 10 in stdout.
How does the input() look like?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Number Line Jumps
You are viewing a single comment's thread. Return to all comments →
Hi, Can I please ask someone to explain the input to me on HackerRank? Why is that if I try: print(input.split(" ")) I just get a 10, while I expect a list numbers in str format. But if I try print(list(map(int, input().split(" "))) I get a list? I have even tried to just print the input: s = input() print(s) but I only a 10 in stdout. How does the input() look like?