Presentation is loading. Please wait.

Presentation is loading. Please wait.

 We are going to learn about programming in general…How to think logically and problem solve. The programming language we will use is Python. This is.

Similar presentations


Presentation on theme: " We are going to learn about programming in general…How to think logically and problem solve. The programming language we will use is Python. This is."— Presentation transcript:

1

2  We are going to learn about programming in general…How to think logically and problem solve. The programming language we will use is Python. This is not meant to be a class in Python, but that is the language we use here…It is free after all. No…Not this kind of python!

3  Computers needs 2 things to run your code – an editor and an interpreter. The editor is what you use to write the code. The interpreter makes the text into binary code that the machine can understand. Our interpreter is Python. Python comes with an application called IDLE which does both functions. Such a program is known as an IDE – Integrated Development Environment.

4  Complete the following exercise. We will go over your answers when everyone is finished.

5 Here’s what the finished code should look like - Now let’s take a closer look at some of the elements of this code…

6  First, we need to realize that there are variables being used. What’s a variable? Basically, a variable is a label for data. So what are the variables in this code?

7 Start by going to the Start button, choosing All Programs, scroll down and click on the Python 3.0 folder, and finally, click on the IDLE(Python GUI). The Python shell should open up just like this…

8  Once the code is entered correctly, the next thing you should do is save your work. Go to the ‘File’ menu and choose ‘Save As’. Name your file game.py. Next, go to the ‘Run’ menu and choose ‘Run Module’.

9 It would be useful to know more than whether your guess is right or wrong. Like maybe if your guess should be higher or lower.

10  Complete the “Program Modification” exercise on the handout.

11 Guess == 5 True False Print(“You Win!”) Too High! Too Low! True False Game Over! Guess > 5

12  Now we need to look at how to write the additional code for the new branch that we have added to the false path… Guess == 5 Print(“You Win!”) Guess > 5 Too High! Too Low! Game Over!


Download ppt " We are going to learn about programming in general…How to think logically and problem solve. The programming language we will use is Python. This is."

Similar presentations


Ads by Google