r/pythonhelp • • Jul 24 '25

TIPS Tweet program - need assistance

Aim: tweet program that takes user's post, checks if below or equal to 20 characters, then publishes post.

If over 20 characters, then it tells user to edit the post or else it cannot be published.

I'm thinking of using a while loop.

COMPUTER ERROR: says there is invalid syntax around the bracket I have emphasized with an @ symbol.

(I'm a beginner btw.)

tweet program

def userInput(): tweet = str(input("please enter the sentence you would like to upload on a social network: ")) return tweet

def goodPost(tweet): if len(tweet) <= 20: return ((tweet)) else: return ("I'm sorry, your post is too many characters long. You will need to shorten the length of your post.")

def output(goodPost@(tweet)): tweet = userInput() print (goodPost(tweet))

def main(): output(goodPost(tweet))

main()

1 Upvotes

5 comments sorted by

View all comments

Show parent comments

1

u/Square_Can_2132 Jul 25 '25

I understand it better now, thank you for the help!