In Python please:
Complete the if-else statement to print 'LOL means laughing out loud' if user_tweet contains 'LOL'.
# Sample output with input: 'I was LOL during the whole movie!'
# LOL means laughing out loud.
user_tweet = input()
''' Your solution goes here '''
print('LOL means laughing out loud.')
else:
print('No abbreviation.')

Respuesta :

ijeggs

Answer:

user_tweet = input("Enter the string from the tweet: ")

word = "LOL"

if word in user_tweet:

 print('LOL means laughing out loud.')

else:

 print('No abbreviation.')

Explanation:

  • Prompt user to enter a string representing the tweet phrase using the input function
  • Store the string a variable called user_tweet
  • use Python's in operator to check if 'LOL' is in the string entered. With an if and else statement print the appropriate message as required by the question

134156

Answer:

Um...What?!

Explanation:

lol