-2
'''

  function 'text_strip_split(text)' delete special symbolsand
  whitespace in start and end string,after we enter number of word ,
  that it should write , and finally write this word.

'''

def text_strip_split(text):

    list = [ '!' , ',' , '.' , '?' , ':' , '/' , '*' , '#' , '%' , '\\' , '_' , '-' , '=' , '+' , '&' ,';']

    for i in list:
        text = text.replace( i  , ' ').strip()
    text = text.split()

    print()

    while True:
        x = int(input('Enter number word that i should print on console:\n')) - 1
        if x > len(list) or x < 0:
            print('Enter other number!')
        else:
            break

    print(text[x])


word = input('Write the something text with special symbols: \n')
print(text_strip_split(word))
chepner
  • 497,756
  • 71
  • 530
  • 681
Aleksei Grabor
  • 153
  • 2
  • 8

1 Answers1

1

You have no return statement in the function.

RomaValcer
  • 2,786
  • 4
  • 19
  • 29
  • Can we help me? How you can combine or simplify my list with special symbols? May be Python have got a something function or module with them? – Aleksei Grabor Jul 20 '18 at 13:40
  • @AlekseiGrabor you may want to look at string.punctuation. It contains all the ASCII punctuation symbols. – RomaValcer Jul 20 '18 at 13:53