Intro to Python (Shell and Editor)

Slide 2:

Go to Menu >> Programming >> Python 3
This is the shell we used last class

This is cool and all, but you can’t save your work.

Slide 3:

Click File -> “New File”   or type ctrl+N

What you will get is a blank document. It will look like this.

Slide 4:

The editor is the place where you write your code and save it for next time.

Write a code where the computer prints something.

Slide 5:

To run the code first save your file. Save it as whatever you want in your home dir.

File -> save as

Slide 6:

Now that your code is saved you can run the code by clicking

Run -> Run Module (or just by clicking f5)

Notice how it opens a new shell window

Slide 7:

A string is just a line of text. We can save a string in a variable.

Notice that there are no quotes in the print function

Assignment:

Write a code that describes the favorite foods of at least 3 people around you. At least 1 of these needs to be saved as a string. Save your code, and run your code. Make the output look something like this…

Hint: you need to use the print function more than once.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.