TypeError: cannot concatenate 'str' and 'int' objects Can someone please help a newbie with their code?

后端 未结 2 2027
我在风中等你
我在风中等你 2021-01-28 08:32

Any help is appreciated, also any big flaws or something you see in the way im formatting or something basic, please point it out. Thanks!

day = raw_input(\"         


        
2条回答
  •  清歌不尽
    2021-01-28 09:22

    the problem is that days is a string.

    when you do

    return 140 * days
    

    it actually multiples your string to 140. so if days == "5" you will have "555555555555555555..." (140 characters)

    you want to operate with integers so do days = int(day) instead

提交回复
热议问题