File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def get_args():
17
17
formatter_class = argparse .ArgumentDefaultsHelpFormatter ,
18
18
)
19
19
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 = "+" )
21
21
22
22
parser .add_argument ("-s" , "--sorted" , help = "Sort the items" , action = "store_true" )
23
23
@@ -29,12 +29,12 @@ def main():
29
29
"""Make a jazz noise here"""
30
30
31
31
args = get_args ()
32
- sort_flag = args .sorted
33
- items = args .items
32
+ items = args .item
34
33
35
- if sort_flag == True :
34
+ if args . sorted == True :
36
35
items .sort ()
37
36
37
+ items_to_bring = ""
38
38
if len (items ) >= 3 :
39
39
items .insert (- 1 , "and " )
40
40
items_to_bring = ", " .join (items [:- 1 ]) + items [- 1 ]
@@ -43,7 +43,7 @@ def main():
43
43
else :
44
44
items_to_bring = items [0 ]
45
45
46
- print ("You are bringing " + items_to_bring + " ." )
46
+ print (f "You are bringing { items_to_bring } ." )
47
47
48
48
49
49
# --------------------------------------------------
You can’t perform that action at this time.
0 commit comments