Lecture 1 Flashcards

1
Q

Define what ‘programming’ means

A

“the process or activity of writing computer programs”

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

What is a ‘computer program’?

A

“a series of coded software instructions to control the operation of a computer or other machine”

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

What is a programming language?

A
  • purely instructive
  • computers have no common sense, so you have to be very precise
  • bridge between machine code and human language
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the different types of languages (or translators)?

Describe the differences.

A

a) interpreted language
- runs line for line
- can be modified whilst program is running
- starts right away after having been given instructions
- runs directly
b) compiled language
- translated all instructions in one go (takes a bit longer to prepare)
- runs very quickly once compiled
- cannot be modified whilst running

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

There are different levels of languages in programming. Lists these levels.

A
  1. Hardware
  2. Machine language
  3. Assembly language
  4. High-level language
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What function do you use to find the length of a list?

A

len()

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

What function do you use to find the type of a value?

A

type()

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

Describe what assembly language consists of

A
  • lowest level of a language humans can practically use

- communicates directly with a computer’s hardware

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

What does a ‘machine language’ consist of?

A
  • binary code
  • easily understandable for machines
  • considered a low-level language
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does a ‘high-level language’ consist of?

A
  • easily understandable for humans

- requires a translator or compiler for translation

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

What is the difference between domain specific languages and general purpose languages?

A

Domain specific languages are specialized to a specific application domain. In example, HTML is only used for webdesign. General purpose languages can be used for a wide array of applications; not one specific task.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
What elements are applicable to Python? Pick one option for each section:
A. High-level/assembly/machine language
B. Interpreted / compiled
C. Domain specific / general purpose
D. Object oriented, yes or no?
A

A. high level
B. interpreted
C. General purpose
D. Yes, it’s object oriented

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

What does IDE stand for?

A

Integrated Development Environment.

It’s a seperate program used to write code in. For example: PyCharm.

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

What is a syntax?

A

“rules that define the structure of a language”

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

Do all programming languages have a syntax?

A

Yes, however, they each use a different one. This means that in each programming language, different rules apply.

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

What is a console?

A

a text-only computer interface. it’s a way to interact with the computer system through text.

17
Q

What is the difference between static and dynamic typing? What does Python use?

A

static typing = having to declare the type of a variable before you can alter it in any way

  • variables have types
  • values have types
e.g. String name;
name = "peter"
name CANNOT be 34, as this is not a string but an integer.
dynamic typing = no need to redeclare a variable when assigning a new variable to it or altering it in any way. 
- variables have no type
- values have types
--> name = "peter"
     name = 34

Python uses dynamic typing

18
Q

integer + float = ?

A

float

19
Q

integer + boolean = ?

A

integer