📖 Beginning Python Programming /
Module: List & Collection

Code Example: Random Quote

📖 Beginning Python Programming / List & Collection / Code Example: Random Quote

Quotes Example v2

from random import choice

quotes = (
    "I want to put a ding in the universe.—Steve Jobs",
    "Life is 10% what happens to you and 90% how you react to it.—Charles R. Swindoll",
    "Family is not an important thing. It's everything.—Michael J. Fox",
    "Nothing is impossible, the word itself says 'I'm possible'!—Audrey Hepburn",
    "There are two ways of spreading light: to be the candle or the mirror that reflects it.—Edith Wharton",
    "Try to be a rainbow in someone's cloud.—Maya Angelou",
    "Be brave enough to live life creatively. The creative place where no one else has ever been.—Alan Alda",
    "The secret of getting ahead is getting started.—Mark Twain",
)

quote = choice(quotes).split("—")

print(f'“{quote[0]}” — {quote[1]}')