Unsupported operand type(s) for ** or pow(): 'str' and 'int'

后端 未结 2 531
一整个雨季
一整个雨季 2021-01-26 10:17

Thats my code, I don\'t know why the program gives me that Error.. PD: I\'m a beginner in this programming language.

import math
while True:
A=input(\"Escribe el         


        
相关标签:
2条回答
  • 2021-01-26 11:03

    Instead of putting input("Escribe el Valor de la 1ra Variable : ")

    Put int(input("Escribe el Valor de la 1ra Variable : ")

    That converts the input to an integer.

    0 讨论(0)
  • 2021-01-26 11:04

    It is failing because input() returns a string. To convert it to an integer, you can use int(some_string).

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