#πŸ”’ Call thecorresponding functions and print the results

11 messages Β· Page 1 of 1 (latest)

oak bison
#

this is my function:

import string

def normal_string(s):
    return s.translate(str.maketrans('', '', string.punctuation)).replace(" ", "").lower()

for i in range(2):
    input_string = input('Enter a word: ')

    normalize_string = normal_string(input_string)

    l = len(normalize_string)
    x = []

    for i in range(l-1, -1, -1):
        g = normalize_string[i]
        x.append(g)
        
    if x == list(normalize_string):
        print('True')
    else:
        print('False')```

i have to include two examples within this and print it out but im not sure how to do that
shrewd trellisBOT
#

@oak bison

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

oak bison
#

Call the corresponding functions and print the results

quick sparrow
#

Print(func(args))

#

Also why is return at the start of the funcs?

manic cedar
#

wraps around

quick sparrow
#

The fun. Is one line?

#

O wait i got it

shrewd trellisBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.