Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent abdbe66 commit 36fd2d1Copy full SHA for 36fd2d1
04_jump_the_five/jump.py
@@ -17,7 +17,7 @@ def get_args():
17
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
18
)
19
20
- parser.add_argument("positional", metavar="str", help="Input text")
+ parser.add_argument("text", metavar="str", help="Input text")
21
22
return parser.parse_args()
23
@@ -27,7 +27,6 @@ def main():
27
"""Make a jazz noise here"""
28
29
args = get_args()
30
- pos_arg = args.positional
31
32
jumper = {
33
"1": "9",
@@ -42,11 +41,7 @@ def main():
42
41
"0": "5",
43
}
44
45
- for char in pos_arg:
46
- if char in jumper:
47
- print(jumper[char], end="")
48
- else:
49
- print(char, end="")
+ print("".join([jumper.get(char, char) for char in args.text]))
50
51
52
# --------------------------------------------------
0 commit comments