Ask coding questions

← Back to all posts
Int and Str error in Python
DavidSafro (19)

Hello there,
So I was just messing around on repl.it, when I suddenly remembered how much I hate doing quadratic equations in school. They're just so long and annoying... anyway since all the good calculators are blocked, I decided to make my own, but ran into an unexpected problem. Whenever I tried to find the first root, it gave me an error saying int or str type not usable for exponent? What's going on?
https://repl.it/@DavidSafro/KosherDraftLaw#main.py

Answered by Coder100 (16858) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (16858)

ur repl is either private or inaccessible.

This is a common error, make sure when you take the input it looks like this:

val = int(input("value: "))

where val is like the variable you would assign it to.

DavidSafro (19)

@Coder100 thx I was thinking my algorithm was the problem but it was the input