File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ """
3+ Author : NowHappy <rlfmalehd@gmail.com>
4+ Date : 2021-10-02
5+ Purpose: Jump the Five
6+ """
7+
8+ import argparse
9+
10+
11+ # --------------------------------------------------
12+ def get_args ():
13+ """Get command-line arguments"""
14+
15+ parser = argparse .ArgumentParser (
16+ description = 'Jump the Five' ,
17+ formatter_class = argparse .ArgumentDefaultsHelpFormatter )
18+
19+ parser .add_argument ('input' ,
20+ metavar = 'str' ,
21+ help = 'Input text' )
22+
23+ return parser .parse_args ()
24+
25+
26+ # --------------------------------------------------
27+ def main ():
28+ """Make a jazz noise here"""
29+
30+ args = get_args ()
31+ text = args .input
32+
33+ jumper = { '1' : '9' ,
34+ '2' : '8' ,
35+ '3' : '7' ,
36+ '4' : '6' ,
37+ '5' : '0' ,
38+ '6' : '4' ,
39+ '7' : '3' ,
40+ '8' : '2' ,
41+ '9' : '1' ,
42+ '0' : '5'
43+ }
44+
45+ for char in args .input :
46+ print (jumper .get (char , char ), end = '' )
47+ print ()
48+
49+
50+ # --------------------------------------------------
51+ if __name__ == '__main__' :
52+ main ()
You can’t perform that action at this time.
0 commit comments