Unit 3: Python
Lesson 1: Introduction to Programming
December 2, 2013
Lesson 1: Introduction to Programming
Introduction to
Programming
Lesson 1

Designing a
Game
Lesson 8

Sorting and
Searching
Lesson 9

Hardware &
Software
Lesson 2

Working with
Files
Lesson 7

Advanced
Algorithms
Lesson 10

Boolean Logic
Lesson 3

Loops
Lesson 6

Navigating the
Web (?)
Lesson 11

Functions
Lesson 4

Data Types
Lesson 5

Putting It All
Together
Lesson 12
2
Technology is transforming our lives!
• Computers and technology are changing the way we live
• Many people carry smartphones wherever they go
• Newspapers are vanishing now that people read the news online
• And most people send far more email than regular mail
• All of this is possible because people learned to program with
computers…but what exactly is programming?

3
Programming means giving instructions to a
computer to do specific tasks (I)
• In our everyday life, we can have many different kinds of
conversations with people around us:
• We argue about the best Harry Potter book
• We discuss the latest Champions League standings
• We explain how to put together that IKEA bookshelf

4
Programming means giving instructions to a
computer to do specific tasks (II)
• In our everyday life, we can have many different kinds of
conversations with people around us:
• We argue about the best Harry Potter book
• We discuss the latest Champions League standings
• We explain how to put together that IKEA bookshelf

• When we talk to computers, we can only have one kind of
conversation:
• We order the computer to complete tasks for us

5
Computers do not understand English!
• If you were to move to France, you might be able to get by through
speaking English alone…but it wouldn’t be easy
• Eventually, you would have to learn to speak French to talk to all the
native French speakers around you

• In the same way, you need to learn a programming language to
communicate with computers

6
Many different programming languages exist
• Just like there are different languages spoken around the world,
there are many programming languages in existence (in fact, new
ones are developed all the time!)
• Some programming languages may be easier to learn while others
may be more concise, but all serve a common purpose: to give
instructions to a computer

7
Python is one of the more popular programming
languages
• Python is a programming language used for everything from working
with scientific data to building web applications
• Python is used on many websites you have probably heard of
use!), such as Google, Pinterest, and Instagram

(and

8
Python was not named after the snake, but…
• …instead after Monty Python, the British comedy series!
• The language got its name because it is intended to be playful and
more fun to learn than traditional programming languages

9
Python is actually very similar to English
• Python is a popular programming language famous for its readability
• Compared to other languages, Python is more similar to English and
therefore more friendly to first-time programmers
• See if you can guess which of the following code snippets are
written in Python!

10
Can you guess which program is written in
Python? (I)

a.
b.
c.
d.

#include <iostream>
int main()
{
std::cout << “Hello, World!” << std::endl;
return 0;
}

11
Can you guess which program is written in
Python? (II)

a.
b.
c.
d.

#include <stdio.h>
int main(int argc, char ** argv)
{
printf(“Hello, World!n”);
}

12
Can you guess which program is written in
Python? (III)

a.
b.
c.
d.

public class Hello
{
public static void main(String argv[])
{
System.out.println(“Hello, World!”);
}
}

13
Can you guess which program is written in
Python? (IV)

a.
b.
c.
d.

print(“Hello, World!”)

14
You can see now why it’s so much easier to learn
Python!
a. C++

b. C

c. Java

d. Python

#include <iostream>
int main()
{
std::cout << “Hello, World!” << std::endl;
return 0;
}
#include <stdio.h>
int main(int argc, char ** argv)
{
printf(“Hello, World!n”);
}
public class Hello
{
public static void main(String argv[])
{
System.out.println(“Hello, World!”);
}
}
print(“Hello, World!”)
15
Summary
• Programming means giving instructions to a computer to do specific
tasks
• Since computers do not understand English, we must learn to use
programming languages to communicate with them

• As a programming language used on many top websites and with a
concise syntax similar to English, Python is both powerful and easy
for beginners to learn

16
What to do on your own
1. Go to URL to complete the Codecademy course online

2. Do the practice set on the material learned

1. Take the follow-up quiz to test your understanding

17

Lesson 301 26 nov13-1500-ay

  • 1.
    Unit 3: Python Lesson1: Introduction to Programming December 2, 2013
  • 2.
    Lesson 1: Introductionto Programming Introduction to Programming Lesson 1 Designing a Game Lesson 8 Sorting and Searching Lesson 9 Hardware & Software Lesson 2 Working with Files Lesson 7 Advanced Algorithms Lesson 10 Boolean Logic Lesson 3 Loops Lesson 6 Navigating the Web (?) Lesson 11 Functions Lesson 4 Data Types Lesson 5 Putting It All Together Lesson 12 2
  • 3.
    Technology is transformingour lives! • Computers and technology are changing the way we live • Many people carry smartphones wherever they go • Newspapers are vanishing now that people read the news online • And most people send far more email than regular mail • All of this is possible because people learned to program with computers…but what exactly is programming? 3
  • 4.
    Programming means givinginstructions to a computer to do specific tasks (I) • In our everyday life, we can have many different kinds of conversations with people around us: • We argue about the best Harry Potter book • We discuss the latest Champions League standings • We explain how to put together that IKEA bookshelf 4
  • 5.
    Programming means givinginstructions to a computer to do specific tasks (II) • In our everyday life, we can have many different kinds of conversations with people around us: • We argue about the best Harry Potter book • We discuss the latest Champions League standings • We explain how to put together that IKEA bookshelf • When we talk to computers, we can only have one kind of conversation: • We order the computer to complete tasks for us 5
  • 6.
    Computers do notunderstand English! • If you were to move to France, you might be able to get by through speaking English alone…but it wouldn’t be easy • Eventually, you would have to learn to speak French to talk to all the native French speakers around you • In the same way, you need to learn a programming language to communicate with computers 6
  • 7.
    Many different programminglanguages exist • Just like there are different languages spoken around the world, there are many programming languages in existence (in fact, new ones are developed all the time!) • Some programming languages may be easier to learn while others may be more concise, but all serve a common purpose: to give instructions to a computer 7
  • 8.
    Python is oneof the more popular programming languages • Python is a programming language used for everything from working with scientific data to building web applications • Python is used on many websites you have probably heard of use!), such as Google, Pinterest, and Instagram (and 8
  • 9.
    Python was notnamed after the snake, but… • …instead after Monty Python, the British comedy series! • The language got its name because it is intended to be playful and more fun to learn than traditional programming languages 9
  • 10.
    Python is actuallyvery similar to English • Python is a popular programming language famous for its readability • Compared to other languages, Python is more similar to English and therefore more friendly to first-time programmers • See if you can guess which of the following code snippets are written in Python! 10
  • 11.
    Can you guesswhich program is written in Python? (I) a. b. c. d. #include <iostream> int main() { std::cout << “Hello, World!” << std::endl; return 0; } 11
  • 12.
    Can you guesswhich program is written in Python? (II) a. b. c. d. #include <stdio.h> int main(int argc, char ** argv) { printf(“Hello, World!n”); } 12
  • 13.
    Can you guesswhich program is written in Python? (III) a. b. c. d. public class Hello { public static void main(String argv[]) { System.out.println(“Hello, World!”); } } 13
  • 14.
    Can you guesswhich program is written in Python? (IV) a. b. c. d. print(“Hello, World!”) 14
  • 15.
    You can seenow why it’s so much easier to learn Python! a. C++ b. C c. Java d. Python #include <iostream> int main() { std::cout << “Hello, World!” << std::endl; return 0; } #include <stdio.h> int main(int argc, char ** argv) { printf(“Hello, World!n”); } public class Hello { public static void main(String argv[]) { System.out.println(“Hello, World!”); } } print(“Hello, World!”) 15
  • 16.
    Summary • Programming meansgiving instructions to a computer to do specific tasks • Since computers do not understand English, we must learn to use programming languages to communicate with them • As a programming language used on many top websites and with a concise syntax similar to English, Python is both powerful and easy for beginners to learn 16
  • 17.
    What to doon your own 1. Go to URL to complete the Codecademy course online 2. Do the practice set on the material learned 1. Take the follow-up quiz to test your understanding 17