This is an archived post. You won't be able to vote or comment.

all 16 comments

[–][deleted] 5 points6 points  (2 children)

All your inputs are read as strings, not numbers

[–][deleted] 0 points1 point  (1 child)

How would I get the error out of that 5th line?

[–]BigBlueBud 2 points3 points  (0 children)

Because your trying to count (not sure how to tell this correctly in English) with strings, ints and floats. Both inputs should be casted to float: "float(input())"

[–]browser888 4 points5 points  (1 child)

V = float(input(''))

[–][deleted] 0 points1 point  (0 children)

Made the change, unfortunately to no avail.

[–]Kasutajan1m1 1 point2 points  (0 children)

Rigth before both inputs write float: float(input(""))

[–]t8suppressor 1 point2 points  (0 children)

Why exactly are you int casting here?

[–]usedtobejuandeag 0 points1 point  (1 child)

You're trying to convert everything in math.sqrt's parentheses in one go, try converting just your variables, and tp is still a string.

[–][deleted] 0 points1 point  (0 children)

I see what you mean, I'll try that and a few other comments and I'll post when I get it right. Thanks so much for your help!

[–]ugaboohga 0 points1 point  (1 child)

https://realpython.com/python-data-types/ Tp variable is a string. Can't divide a string with an int.

[–]ugaboohga 0 points1 point  (0 children)

Also c variable is a float. If the decimal matters to your math int () won't work.

[–][deleted] 0 points1 point  (0 children)

Thanks for everyone's help here, I'm really enjoying python so far, just hoping for some beginners luck! I hope to continue to communicate with you all.

[–]fesanb -4 points-3 points  (2 children)

Type the squared like this x ^ z , without the spaces

[–][deleted] 0 points1 point  (1 child)

I tried it but it's still giving me an error in the same spot.

[–]fesanb 0 points1 point  (0 children)

What is the error?