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.
I solved this problem using a Bash script (cut -c 13-), and now I’m trying to run it in Python 3, but test case 1 keeps failing. Has anyone else tried this and succeeded?
Here’s my code: :-
import sys
for line in sys.stdin:
# remove newline so we control line breaks
line = line.rstrip("\n")
if len(line) < 13:
# If line has fewer than 13 chars, print a blank line
print()
else:
# Print from the 13th character onward
print(line[12:])
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Cut #6
You are viewing a single comment's thread. Return to all comments →
I solved this problem using a Bash script (cut -c 13-), and now I’m trying to run it in Python 3, but test case 1 keeps failing. Has anyone else tried this and succeeded? Here’s my code: :- import sys
for line in sys.stdin: