Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 572 Bytes

File metadata and controls

30 lines (21 loc) · 572 Bytes

Lab 5: Random Emoticon Generator

Let's generate emoticons by assembling a randomly choosing a set of eyes, a nose, and a mouth. Examples of emoticons are :-D =^P and :\

  1. Define a list of eyes
  2. Define a list of noses
  3. Define a list of mouths
  4. Randomly pick a set of eyes
  5. Randomly pick a nose
  6. Randomly pick a mouth
  7. Assemble and display the emoticon
import random

fruits = ['apple', 'banana', 'pineapple']
fruit = random.choice(fruits)
print(fruit)

Example output:

:-P

Version 2

Use a while loop to generate 5 emoticons.