File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def get_args():
1717 formatter_class = argparse .ArgumentDefaultsHelpFormatter ,
1818 )
1919
20- parser .add_argument ("items " , metavar = "str" , help = "Item(s) to bring" , nargs = "+" )
20+ parser .add_argument ("item " , metavar = "str" , help = "Item(s) to bring" , nargs = "+" )
2121
2222 parser .add_argument ("-s" , "--sorted" , help = "Sort the items" , action = "store_true" )
2323
@@ -29,12 +29,12 @@ def main():
2929 """Make a jazz noise here"""
3030
3131 args = get_args ()
32- sort_flag = args .sorted
33- items = args .items
32+ items = args .item
3433
35- if sort_flag == True :
34+ if args . sorted == True :
3635 items .sort ()
3736
37+ items_to_bring = ""
3838 if len (items ) >= 3 :
3939 items .insert (- 1 , "and " )
4040 items_to_bring = ", " .join (items [:- 1 ]) + items [- 1 ]
@@ -43,7 +43,7 @@ def main():
4343 else :
4444 items_to_bring = items [0 ]
4545
46- print ("You are bringing " + items_to_bring + " ." )
46+ print (f "You are bringing { items_to_bring } ." )
4747
4848
4949# --------------------------------------------------
You can’t perform that action at this time.
0 commit comments