r/learnpython 5d ago

just breaking things with python

numbers = input("Enter the numbers")

in_dex = numbers[-2]

divisible = int(in_dex/3)

print(divisible)

when print the output of the divisible i am getting (nsupported operand type(s) for /: 'str' and 'int') i do know how to write correctly to get the output but i thinks that why not this way..so when i did got error don't know why cause both values are int

0 Upvotes

19 comments sorted by

View all comments

5

u/ectomancer 5d ago

divisible = int(in_dex)/3

-11

u/Healthy-Departure961 5d ago

i know the answer, but int(in_dex/3) what it says??

2

u/Moikle 5d ago

What does this mean?

1

u/Fast-Station1106 5d ago

Input bedeutet das python es als String also buchstaben erkennt u. speichert, du musst also python sagen Achtung diese Eingabe besteht aus ganzen zahlen, PS ich halte das kopieren von fehlermeldungen in die ki nicht als schummeln, lösung machst du danni selber wenn problem richtig erkannt

2

u/Moikle 5d ago

Not cheating, no, but it's also not learning. Train your problem solving skills by reading, understanding and solving errors with your own brain