0

I am trying to make a code that has a while loop and inside are executions that show how many sentences have executed. To show you what I mean, here is my code:

while riddle < 11:
    print('this is the '+riddle+ 'th execution')
    riddle = riddle+1

my problem is, if i run it, i have this error:

Traceback (most recent call last):
  File "/home/thejackl/hello world/hello_world.py", line 62, in <module>

   print('this is the '+riddle+ 'th execution')

TypeError: must be str, not int

More information:

  • i am using python 2
  • my complier is pycharm
Random Davis
  • 6,662
  • 4
  • 14
  • 24

0 Answers0