1 / 9

Introduction to Programming: Week 1 Lab Overview and Key Concepts

In this lab session, led by second-year graduate student Linger (Tian Xu), attendees explored basic programming concepts using Python 2.6. The focus was on getting familiar with the IDLE environment, learning about shells and scripts, and understanding the print function. Students were introduced to writing comments, the concept of functions, and handling errors. Example scripts were provided for practical understanding. For continuous learning, resources will be shared via email and a dedicated website will be established for easy access to materials.

gerik
Télécharger la présentation

Introduction to Programming: Week 1 Lab Overview and Key Concepts

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Course A201:Introduction to Programming 09/09/2010

  2. Lab Instructor • Linger(TianXu), second year graduate student • joint degree of Computer Science and Cognitive science • Multisensory Lab directed by Prof. Chen Yu • E-mail: txu@indiana.edu

  3. Special Note! • From now on • Better for you, better for us

  4. Recap • Textbook Chapter 1 to 2 • Get familiar with IDLE designed for python • Know what’s shell, what’s a script • How to print out something by using function ‘print’ • Write comments • What is the concept of ‘function’, can I write one? (more on this in the future) • When error happens, how can I deal with it?

  5. Recap • See the example script -> • This week I will Email you all the example script or slides I used in labs, next I will set up a website you can access all the materials. However, I will mostly use the slides you see in the lecture to avoid redundancy

  6. This week • Let’s open IDLE • Python version 2.6 installed instead of 3.1 • Add this line in the very beginning: from __future__ import print_function, division • Using input will give you an error, use raw_input instead

  7. This week [functions] Ex: radius = float(raw_input(‘Radius: ’)) • This is a combination of two functions: radius = raw_input (‘Radius: ’) # radius now contains a string value radius = float(radius) # radius now contains a float value • Execute this function first

  8. This week • From inside to outside [functions] Ex: radius = float(raw_input(‘Radius: ’)) • This is a combination of two functions: radius = raw_input (‘Radius: ’) # radius now contains a string value radius = float(radius) # radius now contains a float value • Then do the type conversion

  9. Have a nice evening! • See you next time~

More Related