Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Help for a beginner - Index out of range ?
#1
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???
Quote
#2
(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.
Quote
#3
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
Quote
#4
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
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  IndexError: List index out of range issue Adem 1 321 Nov-01-2019, 10:47 PM
Last Post: ichabod801
  IndexError: list index out of range bug? CaptainCsaba 4 316 Oct-18-2019, 12:38 PM
Last Post: CaptainCsaba
  MAWS.py PRGM:IndexError: list index out of range bcramer 0 151 Aug-28-2019, 04:45 PM
Last Post: bcramer
  IndexError: string index out of range ? Q_Y 5 910 Jul-05-2019, 07:18 PM
Last Post: noisefloor
  index out of range rwahdan 3 563 Jul-04-2019, 08:11 PM
Last Post: ichabod801
  Preventing: IndexError: list index out of range PappaBear 1 2,526 Jun-03-2019, 05:50 PM
Last Post: SheeppOSU
  json.load causing IndexError: list index out of range WallyZ 5 778 May-20-2019, 01:11 PM
Last Post: WallyZ
  IndexError: list assignment index out of range Apretext 3 1,036 Apr-25-2019, 09:29 PM
Last Post: Yoriz
  tuple index out of range delta1071 3 1,832 Apr-11-2019, 07:15 AM
Last Post: snippsat
  catching / handle index out of range 3Pinter 3 511 Feb-04-2019, 01:19 PM
Last Post: buran

Forum Jump:


Users browsing this thread: 1 Guest(s)