step 1: create a new python file called fruit machine.py ......e step 1: create a new python file...

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.

Upload: others

Post on 07-Sep-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

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.