my_boolean = False

my_string = "Hello" if my_boolean else "World"

print(my_string)


In this example, we create a new variable called my_boolean and assign it a value of False. 
Then on line 3, we create a new variable called my_string. 
Then we use the if expression to assign a value to my_string based on whether or not a particular condition is true.

The way the if expression works is as follows: <expression1> if <condition> else <expression2>

Expression1 will be the value assigned to my_string if the condition is true, else expression2.
In this case, my_string will be assigned a value of 'World' because the condition (my_boolean) is false.