Structure of Algorithm and Programming Chapter 5

studied byStudied by 249 people
5.0(2)
get a hint
hint

Python

1 / 52

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

Studying Progress

0%
New cards
53
Still learning
0
Almost done
0
Mastered
0
53 Terms
1
New cards

Python

A popular programming language, released in 1991.

New cards
2
New cards

The use of Python

Web development (server-side), Software development, Mathematics and System scripting.

New cards
3
New cards

The creator of Python

Guido van Rossum

New cards
4
New cards

Integrated Development Environment (IDE)

Allows common activities of writing software and identify programming errors.

New cards
5
New cards

Syntax Errors

Refers to the structure of a program and the rules about that structure.

New cards
6
New cards

Runtime Errors

Also called exceptions, usually indicate that something exceptional (and bad) has happened.

New cards
7
New cards

Logic Errors

Code will run successfully but the output is not expected.

New cards
8
New cards

Indentation

The spaces at the beginning of a code line to indicate a block of code and must be at least one.

New cards
9
New cards

Comment and Documentation strings

Use for the purpose of in-code documentation.

New cards
10
New cards

Comments

Start with #

New cards
11
New cards

Documentation string or docstring

Statements that is included within the triple quote """.

New cards
12
New cards

Comment

#This is a message

New cards
13
New cards

Documentation

“““

This is a message

“““

New cards
14
New cards

Reserved words

Have predefined meaning and syntax in the language.

New cards
15
New cards

Variables

The containers for storing data values.

New cards
16
New cards

Variables name

  • must start with a letter or underscore.

  • can only contain alpha-numeric characters and underscores

  • case- sensitive

  • cannot use keywords

New cards
17
New cards

Text Type

str

New cards
18
New cards

Numeric Type

int, float, complex

New cards
19
New cards

Boolean Type

bool

New cards
20
New cards

Sequence type

list, tuple, range

New cards
21
New cards

Set type

set

New cards
22
New cards

Binary type

bytes, bytearray, memoryview

New cards
23
New cards

int

45

New cards
24
New cards

float

45.0

New cards
25
New cards

str

“hello”

New cards
26
New cards

complex

1j

New cards
27
New cards

complex

1+9j

New cards
28
New cards

complex

9j+5

New cards
29
New cards

list

[23,42,54,”hello”]

New cards
30
New cards

tuple

(23,43,54,”hello”)

New cards
31
New cards

tuple((23,43,56))

tuple

New cards
32
New cards

list((9,4,3,2,6))

list

New cards
33
New cards

Arithmetic Operator

+, - , * , / …

New cards
34
New cards

Addition

+

New cards
35
New cards

Subtraction

-

New cards
36
New cards

Multiplication

*

New cards
37
New cards

Division

/

New cards
38
New cards

Modulus

%

New cards
39
New cards

Exponent

**

New cards
40
New cards

Floor division

//

New cards
41
New cards

Relational Operator

>,<,==,<=,>= …

New cards
42
New cards

More than

>

New cards
43
New cards

Less than

<

New cards
44
New cards

Equal

==

New cards
45
New cards

Not Equal

!=

New cards
46
New cards

More than or equal to

>=

New cards
47
New cards

Less than or equal to

<=

New cards
48
New cards

Logical Operator

not, and, or …

New cards
49
New cards

not

not True

New cards
50
New cards

and

True = True + True

False = True +False

False = False + False

New cards
51
New cards

or

True = True + True

True = True + False

False = False + False

New cards
52
New cards

input() function

Ask input from the user

New cards
53
New cards

print() function

Displays the output and jump to the next line.

New cards

Explore top notes

note Note
studied byStudied by 9 people
Updated ... ago
4.0 Stars(1)
note Note
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 96 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 15 people
Updated ... ago
4.5 Stars(2)
note Note
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 61 people
Updated ... ago
5.0 Stars(4)
note Note
studied byStudied by 60077 people
Updated ... ago
4.8 Stars(537)

Explore top flashcards

flashcards Flashcard30 terms
studied byStudied by 156 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard34 terms
studied byStudied by 9 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard42 terms
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard30 terms
studied byStudied by 23 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard55 terms
studied byStudied by 7 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard101 terms
studied byStudied by 2 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard52 terms
studied byStudied by 5 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard44 terms
studied byStudied by 3 people
Updated ... ago
5.0 Stars(1)