What is an inline F statement?
It is a simpler form of an IF statement and is more convenient if you need to perform a very simple task.
What’s the syntax for inline F statement?
do Task A if condition is True else do Task B.
Write the script for inline F function.
userInput = input (“Enter 1 or 2:”)
print(“This is task A” if userInput == “1” else “This is task B”)