Laboratory Walkthrough 1 - Submissiondeadline...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Intro2cs Ex0 ­ Some Basics Submission deadline Tuesday, 22 October, 20:55 Objectives This exercise's purpose is get you familiarized with some basic operations ­ working with the shell, and running your first Python program. 1. Create a directory Create a directory named intro2cs under your safe home-directory ( ~/safe ). You should write your solutions to the intro2cs exercises under this directory (each exercise will have its own directory). Under ~/safe/intro2cs create two directories named: ex0 (for this exercise) and ex1 (for the next exercise). Remember to set the permissions to the intro directory so it will not be accessible/viewable to others. If you're in the directory it could be done by executing chmod 700 . 2. Run a Given Python Program . Using IDLE , create a file named Hello.py under the directory ~/safe/intro2cs/ex0/ (that you've just created). The file should contain the following python code: ############################################################# # FILE : Hello.py # WRITER : your_name + your_login + your_id # EXERCISE : intro2cs ex0 20013­2014 # DESCRIPTION: # A simple program that prints "Hello World" to the standard # output (screen). print( "Hello World") As you can see, this program simply prints the string "Hello World" to the screen. Save the file and run it using the F5 button. Did you see the output in the Python Shell? If you made a mistake while typing the file above, the compiler might describe your error(s). Fix them. Make sure the correct output is printed. Another method to run your code is using the shell. go to and run python3 Hello.py” (without the quotes). Try to run your program also using this method.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
3. Run another Python Program . Using IDLE, we will create another "hello world" program, this time a more complicated one. In python we may import a code written by others, using the import command. Later in the course, we will speak about the importance of import and how python interprets this command and finds the relevant code. For this exercise we will use the module Turtle. This module (or a python file that contains definitions and statements), allow us to create simple graphics.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 4

Laboratory Walkthrough 1 - Submissiondeadline...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online