From 7c29cf94cbe3eea8e9c5b3b720320eda3e5c2802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=B6=9B?= Date: Tue, 8 Nov 2016 14:37:40 +0800 Subject: [PATCH 1/2] Add files via upload --- test1-1.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test1-1.py diff --git a/test1-1.py b/test1-1.py new file mode 100644 index 0000000..c84c541 --- /dev/null +++ b/test1-1.py @@ -0,0 +1,11 @@ +import os + +def backit(astring): + return astring[::-1] + +def main(): + stringa = raw_input("Enter your input: "); + print "result is", backit(stringa) + +if __name__ == '__main__': + main() \ No newline at end of file From 2c09e2764ebae8607db3f1a46ef50f2c3bd77b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=B6=9B?= Date: Tue, 8 Nov 2016 14:45:53 +0800 Subject: [PATCH 2/2] test1-2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 拉丁字母猪 --- test1-2.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test1-2.py diff --git a/test1-2.py b/test1-2.py new file mode 100644 index 0000000..c74b4d5 --- /dev/null +++ b/test1-2.py @@ -0,0 +1,19 @@ +import os +import string + +yuanyin = {'a','e','i','o','u'} + +def backit(astring): + for i,value in enumerate(astring): + if value not in yuanyin and value.isalpha(): + print i + return ''.join(astring[0:i] + astring[i+1:len(astring)] + '-' + value + 'ay') + +def main(): + stringa = raw_input("Enter your input: "); + print "result is", backit(stringa) + + + +if __name__ == '__main__': + main() \ No newline at end of file