Skip to main content
10 events
when toggle format what by license comment
Jul 8, 2018 at 20:46 history edited Martin R CC BY-SA 4.0
added 7 characters in body
Jul 8, 2018 at 20:42 comment added CrazyCasta @MartinR You are correct. I forgot that split does some weird stuff when you don't specify a separator. If you were to do input().split(" ") you'd have a problem. docs.python.org/3.6/library/stdtypes.html#str.split
Jul 8, 2018 at 20:17 comment added Martin R @CrazyCasta: As it seems, splitting a string "1 2 3 \n" gives ['1', '2', '3'], so the split function already consumes the trailing whitespace.
Jul 8, 2018 at 20:10 comment added Martin R @CrazyCasta: Yes, but the int() function does not care about the trailing whitespace. I tested this and it worked correctly.
Jul 8, 2018 at 20:06 comment added CrazyCasta Actually, the rstrip IS required if the line has trailling whitespace. He's not stripping the individual parts, he's stripping the whole line.
Jul 8, 2018 at 9:02 history edited Martin R CC BY-SA 4.0
added 765 characters in body
Jul 8, 2018 at 8:56 history edited Martin R CC BY-SA 4.0
added 765 characters in body
Jul 8, 2018 at 8:29 comment added janos @ananthvankipuram now, you have enough rep to upvote ;-)
Jul 8, 2018 at 7:49 comment added ananth vankipuram don't have enough up vote privilege to up vote your answer, but good nuggets in there. There is always scope for rewriting something using list comprehensions!Thanks
Jul 8, 2018 at 7:36 history answered Martin R CC BY-SA 4.0