Skip to main content
Commonmark migration
Source Link

#Python 2, 62

Python 2, 62

Not going to improve for the bonus, as it's probably not worth the byte cost.

import re
print' '.join(re.split('(?<=[?!.]).',input())[::-1])

#Python 2, 62

Not going to improve for the bonus, as it's probably not worth the byte cost.

import re
print' '.join(re.split('(?<=[?!.]).',input())[::-1])

Python 2, 62

Not going to improve for the bonus, as it's probably not worth the byte cost.

import re
print' '.join(re.split('(?<=[?!.]).',input())[::-1])
added 22 characters in body
Source Link
mbomb007
  • 23.5k
  • 7
  • 63
  • 135

#Python 2, 62

I may improve thisNot going to allow quotes or parentheses laterimprove for the bonus, as it's probably not worth the byte cost.

import re
print' '.join(re.split('(?<=[?!.])',input())[::-1])
import re
print' '.join(re.split('(?<=[?!.]).',input())[::-1])

#Python 2, 62

I may improve this to allow quotes or parentheses later.

import re
print' '.join(re.split('(?<=[?!.])',input())[::-1])

#Python 2, 62

Not going to improve for the bonus, as it's probably not worth the byte cost.

import re
print' '.join(re.split('(?<=[?!.]).',input())[::-1])
Rollback to Revision 1
Source Link
mbomb007
  • 23.5k
  • 7
  • 63
  • 135

#Python 2, 62 66 - 5 = 61

Improved for bonus using raw_input.

import re
print' '.join(re.split('(?<=[?!.]).',raw_input())[::-1])

EDIT: Found that I pasted a wrong version of the code so my very first post didn't work. The regex was missing a .. The byte count was still 62.

#Python 3, 64 - 5 = 59

Shorter since I can use input()may improve this to allow quotes or parentheses later.

import re
print('print' '.join(re.split('(?<=[?!.]).',input())[::-1]))

#Python 2, 62 66 - 5 = 61

Improved for bonus using raw_input.

import re
print' '.join(re.split('(?<=[?!.]).',raw_input())[::-1])

EDIT: Found that I pasted a wrong version of the code so my very first post didn't work. The regex was missing a .. The byte count was still 62.

#Python 3, 64 - 5 = 59

Shorter since I can use input().

import re
print(' '.join(re.split('(?<=[?!.]).',input())[::-1]))

#Python 2, 62

I may improve this to allow quotes or parentheses later.

import re
print' '.join(re.split('(?<=[?!.])',input())[::-1])
added 117 characters in body
Source Link
mbomb007
  • 23.5k
  • 7
  • 63
  • 135
Loading
Source Link
mbomb007
  • 23.5k
  • 7
  • 63
  • 135
Loading