Python module 1 Flashcards

1
Q

Name four simplace actions to form a program:

A

Accept a number representing distance
Accept a number representing travel time
Divide the former value by the later and store the result in memory
Display the result (representing average speed) in a readable format

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Machine Language is ____

A

Rudimentary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Instruction List

A

Sometimes Abbreviated IL. Different types of computers may vary depending of their ILs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Each Language (machine or natural) consists of the following elements:

A

An Alphabet
A Lexis
A syntax
Semantics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Alphabet

A

A set of symbols used to build words of a certain language (e.g., the Latin alphabet for English, the Cyrillic alphabet for Russian, Kanji for Japanese and so on)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Lexis

A

(aka a dictionary) a set of words the language offers its users (e.g., the word “computer” comes from the English language dictionary, while “cmoptrue” doesn’t; the word “chat” is present both in English and French Dictionaries, but their meanings are different)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Syntax

A

A set of rules (formal or informal, written or felt intuitively) used to determine if a certain string of words forms a valid sentence (e.g., “I am a python” is a syntactically correct phrase, while “I a python am” Isn’t)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Semantics

A

a set of rules determining if a certain phrase makes sense (e.g., “I ate a doughnut” makes sense, but “A doughnut ate me” doesn’t.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The IL is

A

The alphabet of a machine language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A program written in a high-level programming language is called

A

a source

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Source file

A

the file containing the source code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The two ways of transforming a program from a high-level programming language into machine language:

A

Compilation
Interpretation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Compilation

A

The source program is translated one (however, this act must be repeated each time you modify the source code) by getting a file (e.g., an .exe file if the code is intended to be run under MS Windows) containing the machine code; now you can distribute the file wordwide; the program that performs this translation is called a compiler or translator;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Interpretation

A

you (or any user of the code) 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 as0is, because the end-user also needs the interpreter to execute it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Text file

A

a computer program consisting of text after writing a program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Pure text

A

without any decorations like fonts, colors, or embedded images or other media. Now you have to invoke the interpreter and let it read your source file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

If the interpreter finds an error it finishes its work immediately. The only result in this case is an___

A

Error Message

18
Q

Comiplation Advantages

A
  • the execution of the translated code is usually faster;
  • only the user has to have the compiler - the end-user may use the code without it;
  • the translated code is stored using machine language - as it is very hard to understand it, your own inventions and programming tricks are likely to remain your secret.
19
Q

Compilation Disadvantages

A
  • the compilation itself may be a very time-consuming process - you may not be able to run your code immediately after making an amendment;
  • you have to have as many compilers as hardware platforms you want your code to be run on.
20
Q

Interpretation Advantages

A
  • you can run the code as soon as you complete it - there are no additional phases of translation;
  • the code is stored using programming language, not machine language - this means that it can be run on computers using different machine languages; you don’t compile your code separately for each different architecture.
21
Q

Interpretation Disadvantages

A
  • don’t expect interpretation to ramp up your code to high speed - your code will share the computer’s power with the interpreter, so it can’t be really fast;
  • both you and the end user have to have the interpreter to run your code.
22
Q

Python is

A

an interpreted language

23
Q

Programming Python requires

A

Python Interpreter

24
Q

Scripting Language

A

languages designed to be utilized in the interpretation manner

25
Q

Source programs encoded using scripting languages are called

A

Scripts

26
Q

Creator of Python

A

Guido van Rossum

27
Q

In 1999, Guide Van Rossum defined his goals for Python:

A
  • An easy and intuitive language just as powerful as those of the major competitors;
  • Open source, so anyone can contribute to its development
  • code that is as understandable as plain English
  • suitable for every day tasks, allowing for short development times.
28
Q

Python trivia

A

it is a low level program
Not used in mobile devices yet

29
Q

Two main kinds of Python

A

Python 2 – dead end development but still very much alive and in use
Python 3 – newer and more current. Still creating its own standards and habits.

30
Q

If you’re going to start a new Python project

A

you should use Python 3, and this is the version of Python that will be used during this course.

31
Q

Name all canonical or reference Pythons

A

CPython
Cython
Jython
PyPy
Rpython

32
Q

Cython

A

one of a possible number of solutions to Python’s lack of efficiency. Large and complex mathematical calculations may be easily coded in python (much easier than in “C” or any other traditional language), but the resulting code execution may be extremely time-consuming. This reconciled by running it through Cython. This is done because it translates the script into “C”

33
Q

CPython

A

PSF (Python Software Foundation) version of Python

34
Q

Jython

A

utilizes Java instead of C. It only works with Python 2 and there is currently nothing that translates in to Python 3 so far

35
Q

PyPy and RPython

A

a Python within a Python. In other words, it represents a Python environment written in Python-like language named RPython (Restricted Python). It is actually a subset of Python

36
Q

This course will focus on which deviation of Python?

A

CPython

37
Q

Editor

A

A tool that give you more help than a simple tool

38
Q

Console

A

Helps stop code forcibly when it gets out of control

39
Q

Debugger

A

A tool that will launch your code step-by-step which will allow you to inspect the code at each moment of execution

40
Q

IDLE

A

Integrated Development and Learning Environment