Functions

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

how can I make it so I my function will not accept intergers
<In what way does your code behave incorrectly? Include ALL error messages.>

<What do you expect to happen instead?>

```python

user_input = raw_input(‘Welcome to Pyg Latin. Please enter a word:’)

pyg = “ay”
user_first_letter = user_input[0]
user_word_sliced = user_input[1:]

def pyg_latin_function():
if len(user_input) >= 3 :
print user_word_sliced + user_first_letter + pyg

else :
    print 'word please'

print pyg_latin_function()

<do not remove the three backticks above>

Do you want absolutely no numbers in the string at all i.e. “string1” or only actual numbers i.e “12”?

But as a general rule, you will either use an if statement or a try statement, maybe in a loop.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.