2021年1月18日星期一

How do you .format when it comes to return statements in Python?

this is my list:

['1', ('242','18'), ('13','1'),('349','2')]  

and i want to make that a parameter of a function and have a return statement that when printed, it would produce this :

Shopping Budget: Week 1   Monday = 242, Items = 18  Tuesday = 13, Items = 1  Wednesday = 349, Items = 2  

im struggling to .format this correctly because my for loop would print "shopping budget" along with it.

i want to be able to return this function with any numbers in my list

https://stackoverflow.com/questions/65784552/how-do-you-format-when-it-comes-to-return-statements-in-python January 19, 2021 at 10:01AM

没有评论:

发表评论