Download
comp 102 computers and computing n.
Skip this Video
Loading SlideShow in 5 Seconds..
Mike Hallett, bci.mcgill michael.t.hallett@mcgill PowerPoint Presentation
Download Presentation
Mike Hallett, bci.mcgill michael.t.hallett@mcgill

Mike Hallett, bci.mcgill michael.t.hallett@mcgill

428 Vues Download Presentation
Télécharger la présentation

Mike Hallett, bci.mcgill michael.t.hallett@mcgill

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. COMP 102: Computers and Computing Programming with Python 3 Mike Hallett, www.bci.mcgill.ca michael.t.hallett@mcgill.ca Python 3.x Lecture 8

  2. Computer program: A list of instructions that tell a computer what to do in order to achieve some predefined task. Computer language: A formal constructed language for expressing computer programs. Computer programming: The art and science of writing programs in a specific programming language.

  3. There are many computer languages. From very “high level” to very “low level”. With many different mandates. This is an example of machine language. It is one step away from the binary 0/1 logical circuits that a computer is made of. The numbers are in hexadecimal (base 16)… for reasons you’ll soon understand.

  4. There are many computer languages. From very “high level” to very “low level”. With many different mandates. Assembler Code: One step away from machine language. Very simple code.

  5. There are many computer languages. From very “high level” to very “low level”. With many different mandates. Fortran, one of the first high level languages for scientific computing.

  6. There are many computer languages. From very “high level” to very “low level”. With many different mandates. C, the lowest of the high level languages.

  7. There are many computer languages. From very “high level” to very “low level”. With many different mandates. R, an interpreted language for statistics.

  8. There are many computer languages. From very “high level” to very “low level”. With many different mandates. Java, an object oriented high level language.

  9. There are many computer languages. From very “high level” to very “low level”. With many different mandates. Scratch was made for children to program simple graphical games.

  10. Python, the programming language https://www.python.org/ A beginner’s guide to programming (with Python) https://www.python.org/about/gettingstarted/ Interactive Development Environment (IDE) Thonny (Python 3.5 comes with it) http://thonny.cs.ut.ee/ An alternative IDE: PyScripter http://code.google.com/p/pyscripter If you really really can’t get Python installed on your machine, use: https://www.python.org/shell/ A tutorial/textbook for beginners with Python. http://openbookproject.net/thinkcs/python/english3e/

  11. Take home messages • Lots of programming languages • Python’s been around for a while, pretty popular, many internet apps written in it • IDEs • Use Python version 3.x • Read Chapters 1 and 2 Actionable Items • Write a program that ask the user for their first name, middle initial and last name, and prints them out in the format • Hallett, Michael T • Define three variables x, y, and z and assign three (arbitrary) • integers to them. For example, x = 1, y= 2 and z = 3. • Write a program to make a “three-way swap” so that afterwards y has the value that initially in x, z has the value • from y, and x has the value from z.