2
Fruit Machine STEP 1: Create a new Python file called Fruit Machine.py STEP 2: Add the following code to your program. Save and run the code to make sure it works. Here we set up a function called fruit_machine and call it at the bottom of our code. We also get some user input. Remember indenting is very important!! STEP 3: Now let’s set up an Array. This is a list of Variables, storing different values.

STEP 1: Create a new Python file called Fruit Machine.py ......e STEP 1: Create a new Python file called Fruit Machine.py STEP 2: Add the following code to your program. Save and run

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: STEP 1: Create a new Python file called Fruit Machine.py ......e STEP 1: Create a new Python file called Fruit Machine.py STEP 2: Add the following code to your program. Save and run

Fruit Machine STEP 1:Create a new Python filecalled Fruit Machine.py

STEP 2:Add the following code to your program.Save and run the code to make sure it works.

Here we set up a function called fruit_machine and call itat the bottom of our code.We also get some user input.Remember indenting is very important!!

STEP 3:Now let’s set up an Array. This is a list of Variables,storing different values.

Page 2: STEP 1: Create a new Python file called Fruit Machine.py ......e STEP 1: Create a new Python file called Fruit Machine.py STEP 2: Add the following code to your program. Save and run

STEP 4:Next, let’s make some random selections from our Array.

STEP 5:Now we need to print those selections on the screen.

STEP 6:Let’s add somematching logic to ourrandom selections.