Help a python beginner


#1

Hi guys, I am relatively new to python, i encountered the code below, can someone help me resolve it please

list = "PYTHON"
size = len(list)
name = (size // 3)
for i in range(len(list)):
    temp = name[i]
    name[i] = (temp - i - 1)
    temp = (name - i - 1)
print name

#2

this line:

temp = name[i]

the variable name contains a integer, sure that shouldn't be list[i]? You can't access a integer with a index


#3

Hi, @mwangi29 ,

As @stetim94 has pointed out, the code is buggy. There are several problems with it. But to make suggestions regarding how to fix it, we need to know what the code is supposed to do. Is there any information about the intent of the code that you could post here?