1 of 7

Introduction to Computer Programming��Python

Ziyang Wang

https://www.zywang.site/

8/July/2024

1/7

2 of 7

Why

Give me a photo of a doctor working.

(Source: PYPL Popularity of Programming Language)

Web Development

AI & Data Science

2/7

3 of 7

What

Python is a high-level, general-purpose, interpreted programming language.

How

On your personal computer.

A web browser-based Python service.

3/7

4 of 7

Interpreter

  • A function is a block of code which only runs when it is called.
  • You can pass data, known as parameters, into a function.
  • A function can return data as a result.

The Python function print() displays whatever is between the parentheses (...)

  • Interpreter translates each statement into instructions that the computer's CPU can understand and execute immediately.

Functions

4/7

5 of 7

Variables and Variable Assignment

  • Variables are containers for storing data values.
  • A variable is created the moment you first assign a value to it.
  • We can assign a value to a variable, using the equals sign =.

bottle

(Variable)

5

X

water

(Value)

5

5/7

6 of 7

Summary

  • Programming is to create a set of instructions that tell a computer how to perform a task.

  • Python is a high-level, general-purpose, interpreted programming language.

  • Interpreter reads and executes code directly from the source written by the programmer.

  • Functions are reusable blocks of code designed to perform a specific task.

  • Variables are names that you assign to data in your program.

6/7

7 of 7

More Examples and Quizzes?

Code

The code utilized in this course can be accessed here:

7/7