PCEP|Certified Entry-Level Python Programmer Certification

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/42

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

43 Terms

1
New cards

Syntax

A set of rules used to determine if a certain string of words form a valid sentence.

*Syntactically-each language has its rules and they must be obeyed.

2
New cards

Semantics

A set of rules determining if a certain phrase makes sense.

*Semantically-the program has to make sense.

3
New cards

Lexis

(Aka Dictionary) as set of words the language offers its users.

*Lexically-each programming language has its dictionary and you need to master it.

4
New cards

Interpreting

you can translate the source program each time it has to be run; the program performing this kind of transformation is called an interpreter. As it interprets the code every time it is intended to be executed; it also means that you cannot just distribute the source code as-is, because the end-user needs the interpreter to execute it.

*Python is an interpreted Language

5
New cards

Interpreter

An interpreter is a program that reads and executes code

-An interpreter will:

1. Check if all subsequent lines are correct

2. if an error is found d the interpreter stops and an error message is made.

3. the interpreter lets you know where the error is located and what caused it.

4. If the line is good the interpreter tries to execute it.

*Each line is usually executed separately.

6
New cards

Compilation

The source program is translated once (however, this act must be repeated each time you modify the source code) by getting a file (e.g. an .exe if the code is intended to be run under windows) containing the machine code; now you can distribute the file worldwide.

7
New cards

Compiler

The program that performs the translation is called a compiler or translator.

8
New cards

Python keywords

Keywords are the reserved words in Python

*True, False, is, if, in, elif, etc.

9
New cards

Indenting

Leading white-space (spaces or tabs) at the beginning of a logical line is used to compute the indentation level of the line, which in turn is used to determine the grouping of statements.

10
New cards

Literals

A literal is data whose values are determined by the literal itself.

*[123] is a literal, and [C] is not.

11
New cards

Boolean

A Boolean expression (or logical expression) evaluates to one of two states, True or False.

Python provides the Boolean type that can be either False or True. Many functions and operations return Boolean objects. The not keywords can also be used to inverse a Boolean type.

12
New cards

Integer

Those #'s that are devoid of the fractional part

Whole numbers: Ex. 17

13
New cards

Floating-Point Numbers

(or simply floats), that contain (or are able to contain) the fractional part.

Example 17.0

14
New cards

Scientific Notations

Python uses special syntax to write #'s in scientific notation

Example: 0.000000123 can be written as [1.23E-7]

The letter E is called exponent and it doesn't matter whether you use e or E.

Complex #'s are the #'s which we can't represent on a # line.

15
New cards

Strings

Are used when you need to process text. (Strings need "quotes"). It is not intended to be executed, and should be taken as is.

16
New cards

Comments

A comment is a piece of text that begins with [#] (hash) sign and extends to the end of the line.

17
New cards

[print()]

is a function that prints the specified message to the screen, or other standard output device.

18
New cards

[input()]

The [inpout()] function is able to read data entered by the user and to return the same data to the running program. The program can manipulate the data, making the code truly interactive.

*The function will switch the console to input mode.

*The result of the [input()] function is also a string.

19
New cards

[0b]

binary

20
New cards

[0o]

Octal: If an integer # is preceded by an [0o] prefix (zero - o) it will be treated as an octal value. This means that the # must contain digits taken from the {0.....7} range only.

21
New cards

[0x]

Hexadecimal

22
New cards

Numeric Operators

Symbols in programming language, which are able to operate on the values.

Example: + , - , , / , // , % , *

23
New cards

[**]

A double asterisk sign is an exponentiation (power) operator. The left argument is the base, its right, the exponent.

Example: [2**3]

24
New cards

[*]

An asterisk is multiplication

25
New cards

[/]

A slash is division

Note: The result produced by the division operator is always a float

26
New cards

[%]

A [%] (percent sign) is a reminder (modulo), aka remainder left after the integer division.

Example: [14%4] =2

4+4+4=12 14/12=2

27
New cards

[//}

A [//] (double slash) sign is an integer divisional operator.

NOTE: NOT FLOAT!! The answer is rounded to the lesser integer.

Example: 2.7=2 2.3=2

28
New cards

[+]

Addition

29
New cards

[-]

Subtraction

30
New cards

Assignments Operators

Assignment operators are used in Python to assign values to variables. (a=5) is a simple assignment operator that assigns the value 5 on the right to the variable a on the left. There are various compound operators in Python like a+=5 that adds to the variable and later assigns the same.

31
New cards

[\n]

new line character

causes a break where placed so output starts on a new line.

[\]-the escape character [n]-newline

32
New cards

["James"*3]

"JamesJamesJames"

The asterisk sign, when applied to a string and a number becomes a replication operator.

[3*"an"] = "ananan"

33
New cards

[str()]

the [str()] function converts the specific value into a string.

34
New cards

Lists

A type of data structure. An ordered sequence of objects.

[10,"hello",200.3]

35
New cards

Dictionaries

Unordered key:value pairs

{"mykey":"value", "name":"Frank"}

36
New cards

Tuples

Ordered immutable sequences of objects. AKA you cannot edit them.

(10,"hello",200.3)

37
New cards

Sets

Unordered collection of unique objects.

{"a","b"}

38
New cards

[type()]

Is used to check the type of object a variable is

a=3

type(a)

int

39
New cards

[len()]

Checks the length of the input

len("hello")

5

40
New cards

list1 = [1,2,3]

Lists can be changed

41
New cards

dict1 = {'key1': 'value1'}

dictionary can be changed

42
New cards

tuple1 = (1,2,3)

Tuples cannot be changed

43
New cards

list.index('b')

identified the index position of an item in a list