Python Forum
Help for a beginner - Index out of range ? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Help for a beginner - Index out of range ? (/thread-16493.html)



Help for a beginner - Index out of range ? - MarcM0901 - Mar-02-2019

Hi all,

First time here .
And i am a beginner.
I do not know if this is the right place for a question.
I am trying to find why my program is out of index.
I have researched everything for hours and I am getting crazy.
I need help.
Can I post my code here???


RE: Help for a begginer - buran - Mar-02-2019

(Mar-02-2019, 08:18 AM)MarcM0901 Wrote: Can I post my code here???
Sure, post your code as well as the full traceback (error message) that you get. Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.


RE: Help for a begginer - MarcM0901 - Mar-03-2019

Here is my code:

def get_initials(fullname):
name_upper = fullname.upper()
split_name = name_upper.split(" ")
for new_name in range (len([split_name])):
print(split_name[0][new_name],end='')
return(split_name[1][new_name])


def main():
fullnameinput = input("What is your name? ")
#print(fullnameinput)
print(get_initials(fullnameinput))
if __name__ == "__main__":


'''The error is:

Index out of range
'''

And I can not understand why

Thank You


RE: Help for a begginer - buran - Mar-04-2019

You were explicitly advised to use BBCode tags.
Also you were asked to provide full traceback.
You did none of the above.
Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.
Please, post the entire traceback that you get. We need to see the whole thing. Do not just give us the last line.
Take a time to read What to include in a post