Search Header Logo
Python_Lesson 2

Python_Lesson 2

Assessment

Presentation

Computers

6th Grade

Easy

Created by

Viktoriia Kapustianchyk

Used 1+ times

FREE Resource

17 Slides • 1 Question

1

PYTHON OPERATORS

  • Lesson 2

media

2

3

​Programming Languages

  • ​Programs are written in languages called programming languages.

  • ​Humans can understand high-level languages such as Python, C# and Java.

  • ​Computers can understand low-level languages such as Assembly Language and Machine Code.

media

4

​Compilers & Interpreters

  • Translate programs from high-level to low-level languages.

  • ​Interpreters translate code line by line.

  • ​Interpreters are used each time the code is run.

  • ​Compilers translate code all at once and make an executable file.

media

5

Python

  • Python is a powerful high level language

  • It is an Object Oriented Programming Language

  • It was developed by Guido Van Rossum

media

6


print("Hello world")

world =
print("Hello", world)

media

7

Python Operators

Operators are special symbols, or combinations of symbols, that designate some type of computation.

8

+ - * /


These are the basic mathematical operators.

9

In Python you can use maths operators to do sums:

+

add

-

subtract

*

multiply

/

divide

**

to the power




Create a calculation

print(230 5782 * 2 / 23781)

10

Match

Match the following

/

*

+

=

-

divided by

multiplied by

add

assigns a value

substract

11

print()

Don't forget: we can use the print() command to display an output.
e.g. print(14-2)
would show 12 as an output

12

Concatenating

If we want to output several things at once, we can separate them with commas:
e.g. print("There are ", 3, " left")
would output: There are 3 left

13

=

= does not work as a mathematical operator. Instead, = is used to assign a value to a variable.
e.g. name = "John Smith"

14

=

However, we can use = to assign a value to a variable that is the result of a calculation.
e.g. result = 3 + 5
print(result)
This will output the value 8.

15

==

This operator will check if two pieces of data are equal. If they are, it will return a value of true.
e.g. 2==2 will return a value of true
2==5 will return a value of false

16

Try the following statements in python window or make use of online link and give output:

  • print ("Welcome")

  • print (4+5+7)

  • print (89-5+7*4)

17

media

18

PYTHON OPERATORS

  • Lesson 2

media

Show answer

Auto Play

Slide 1 / 18

SLIDE