Python 3 TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'

前端 未结 1 1409
独厮守ぢ
独厮守ぢ 2021-01-26 01:24
#Import the module
from math import sqrt

#Using while loop statement to make the program not finish before the user close the program.
while True:

#Print out the intro         


        
1条回答
  •  有刺的猬
    2021-01-26 02:09

    The reason giving u type error is you did not store and update the variables after calling the function.

    Try

     a = func_num(a)
     b = func_num(b)
     c = func_num(c)
    

    And modify your function to return n because you only passing a copy n into the function

    0 讨论(0)
提交回复
热议问题