Part 2, Introduction to problem solving in python Flashcards

1
Q

what is one way of expressing in an algorithm that we need to do something for a number of times

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

when designing an algorithm what signs can be used to represent the problem(1) and any subproblems(2)

A
  1. >
  2. >>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  1. this is used to hold many values within a single variable
  2. each item within this is known as an element and each element can be accessed via its index number, that is its position inside the —- starting from 0
A

what is a list, and what terms are used to desribe its parts

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

in python this is used to return a sequence of numbers

A

what is the python range() function used for

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

these can be translated into code by creating them as comments within the code

A

the symbols > and >> can be used to represent the problem and any subproblems of an algorithm, how do these later translate into code

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

range(start, stop, step)

  1. start - the number you would like to start from (included in sequence)
  2. stop - the number you would like to stop at (excluded from sequence)
  3. step - the increment of the sequence (default 1)
A

describe the python range() parameters

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

what is a list, and what terms are used to desribe its parts

A
  1. this is used to hold many values within a single variable
  2. each item within this is known as an element and each element can be accessed via its index number, that is its position inside the —- starting from 0
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

will print ‘hello world’ and then a space (does not start a new line)

A

describe what the following python code does

Print(‘hello world’, end = ‘ ’)

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

this is of the form “variable = expression”. The expressions value is found first and then stored inside the variable.

A

what is an assignment

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

what are the 7 steps of the problem solving process

A
  1. problem
  2. decompose
  3. sub problems
  4. decompose
  5. algorithm
  6. implement
  7. code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A statement where some code only gets executed under certain circumstances, determined by a boolean condition

A

what is a conditional statement

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

what is one way of expressing in an algorithm that we need to do something for a number of times

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

describe what the following python code does

Print(‘hello world’)

A

will print ‘hello world and start a new line

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

describe what the following python code does

Print(‘hello world’, end = ‘ ’)

A

will print ‘hello world’ and then a space (does not start a new line)

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

describe the python for loop syntax

A

for x in (list, a tuple, a dictionary, a set, or a string)

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

for x in (list, a tuple, a dictionary, a set, or a string)

A

describe the python for loop syntax

17
Q

will print ‘hello world and start a new line

A

describe what the following python code does

Print(‘hello world’)

18
Q
  1. >
  2. >>
A

when designing an algorithm what signs can be used to represent the problem(1) and any subproblems(2)

19
Q

A way of structuring code that a programming language recognises as having a particular meaning

A

what is a programming construct

20
Q
  1. problem
  2. decompose
  3. sub problems
  4. decompose
  5. algorithm
  6. implement
  7. code
A

what are the 7 steps of the problem solving process

21
Q

describe the python range() parameters

A

range(start, stop, step)

  1. start - the number you would like to start from (included in sequence)
  2. stop - the number you would like to stop at (excluded from sequence)
  3. step - the increment of the sequence (default 1)
22
Q

what is a programming construct

A

A way of structuring code that a programming language recognises as having a particular meaning

23
Q

the symbols > and >> can be used to represent the problem and any subproblems of an algorithm, how do these later translate into code

A

these can be translated into code by creating them as comments within the code

24
Q

what is a conditional statement

A

A statement where some code only gets executed under certain circumstances, determined by a boolean condition

25
Q

what is an assignment

A

this is of the form “variable = expression”. The expressions value is found first and then stored inside the variable.

26
Q

will print a new line

A

describe what the following python code does

print()

27
Q

what is selection

A

Where some code is only carried out under certain circumstances

28
Q

Where some code is only carried out under certain circumstances

A

what is selection

29
Q

describe what the following python code does

print()

A

will print a new line

30
Q

what is the python range() function used for

A

in python this is used to return a sequence of numbers