File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ def get_args():
1313 description = 'Apples and bananas' ,
1414 formatter_class = argparse .ArgumentDefaultsHelpFormatter )
1515
16- parser .add_argument ('text' , metavar = 'str ' , help = 'Input text or file' )
16+ parser .add_argument ('text' , metavar = 'text ' , help = 'Input text or file' )
1717
1818 parser .add_argument ('-v' ,
1919 '--vowel' ,
2020 help = 'The vowel to substitute' ,
21- metavar = 'str ' ,
21+ metavar = 'vowel ' ,
2222 type = str ,
2323 default = 'a' ,
2424 choices = list ('aeiou' ))
@@ -38,9 +38,8 @@ def main():
3838 args = get_args ()
3939 text = args .text
4040 vowel = args .vowel
41-
42- # Method 1: Iterate every character
4341 new_text = []
42+
4443 for char in text :
4544 if char in 'aeiou' :
4645 new_text .append (vowel )
Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ def get_args():
1414 description = 'Apples and bananas' ,
1515 formatter_class = argparse .ArgumentDefaultsHelpFormatter )
1616
17- parser .add_argument ('text' , metavar = 'str ' , help = 'Input text or file' )
17+ parser .add_argument ('text' , metavar = 'text ' , help = 'Input text or file' )
1818
1919 parser .add_argument ('-v' ,
2020 '--vowel' ,
2121 help = 'The vowel to substitute' ,
22- metavar = 'str ' ,
22+ metavar = 'vowel ' ,
2323 type = str ,
2424 default = 'a' ,
2525 choices = list ('aeiou' ))
Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ def get_args():
1414 description = 'Apples and bananas' ,
1515 formatter_class = argparse .ArgumentDefaultsHelpFormatter )
1616
17- parser .add_argument ('text' , metavar = 'str ' , help = 'Input text or file' )
17+ parser .add_argument ('text' , metavar = 'text ' , help = 'Input text or file' )
1818
1919 parser .add_argument ('-v' ,
2020 '--vowel' ,
2121 help = 'The vowel to substitute' ,
22- metavar = 'str ' ,
22+ metavar = 'vowel ' ,
2323 type = str ,
2424 default = 'a' ,
2525 choices = list ('aeiou' ))
Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ def get_args():
1414 description = 'Apples and bananas' ,
1515 formatter_class = argparse .ArgumentDefaultsHelpFormatter )
1616
17- parser .add_argument ('text' , metavar = 'str ' , help = 'Input text or file' )
17+ parser .add_argument ('text' , metavar = 'text ' , help = 'Input text or file' )
1818
1919 parser .add_argument ('-v' ,
2020 '--vowel' ,
2121 help = 'The vowel to substitute' ,
22- metavar = 'str ' ,
22+ metavar = 'vowel ' ,
2323 type = str ,
2424 default = 'a' ,
2525 choices = list ('aeiou' ))
Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ def get_args():
1414 description = 'Apples and bananas' ,
1515 formatter_class = argparse .ArgumentDefaultsHelpFormatter )
1616
17- parser .add_argument ('text' , metavar = 'str ' , help = 'Input text or file' )
17+ parser .add_argument ('text' , metavar = 'text ' , help = 'Input text or file' )
1818
1919 parser .add_argument ('-v' ,
2020 '--vowel' ,
2121 help = 'The vowel to substitute' ,
22- metavar = 'str ' ,
22+ metavar = 'vowel ' ,
2323 type = str ,
2424 default = 'a' ,
2525 choices = list ('aeiou' ))
Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ def get_args():
1313 description = 'Apples and bananas' ,
1414 formatter_class = argparse .ArgumentDefaultsHelpFormatter )
1515
16- parser .add_argument ('text' , metavar = 'str ' , help = 'Input text or file' )
16+ parser .add_argument ('text' , metavar = 'text ' , help = 'Input text or file' )
1717
1818 parser .add_argument ('-v' ,
1919 '--vowel' ,
2020 help = 'The vowel to substitute' ,
21- metavar = 'str ' ,
21+ metavar = 'vowel ' ,
2222 type = str ,
2323 default = 'a' ,
2424 choices = list ('aeiou' ))
Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ def get_args():
1313 description = 'Apples and bananas' ,
1414 formatter_class = argparse .ArgumentDefaultsHelpFormatter )
1515
16- parser .add_argument ('text' , metavar = 'str ' , help = 'Input text or file' )
16+ parser .add_argument ('text' , metavar = 'text ' , help = 'Input text or file' )
1717
1818 parser .add_argument ('-v' ,
1919 '--vowel' ,
2020 help = 'The vowel to substitute' ,
21- metavar = 'str ' ,
21+ metavar = 'vowel ' ,
2222 type = str ,
2323 default = 'a' ,
2424 choices = list ('aeiou' ))
Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ def get_args():
1414 description = 'Apples and bananas' ,
1515 formatter_class = argparse .ArgumentDefaultsHelpFormatter )
1616
17- parser .add_argument ('text' , metavar = 'str ' , help = 'Input text or file' )
17+ parser .add_argument ('text' , metavar = 'text ' , help = 'Input text or file' )
1818
1919 parser .add_argument ('-v' ,
2020 '--vowel' ,
2121 help = 'The vowel to substitute' ,
22- metavar = 'str ' ,
22+ metavar = 'vowel ' ,
2323 type = str ,
2424 default = 'a' ,
2525 choices = list ('aeiou' ))
You can’t perform that action at this time.
0 commit comments