Chapter 53 - Programming basics Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is an algorithm?

A

» A set of rules or a sequence of steps specifying how to solve a problem

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

What is pseudocode?

A

» Shows the important aspects of coding without an syntaxes

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

What is a comment?

A

» Allows you to document your code and explains what the code does

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

What is an integer?

A

» A whole number

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

What is a real/float?

A

» Number with a fractional part which can be negative

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

What is a character?

A

» A letter or a number

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

What is a string?

A

» Anything enclosed in quote marks or double quotes

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

What does the round function do?

A

» Round the number

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

What does the div function do?

A

» Return the whole numer

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

What does mod do?

A

» Finds the remainder

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

What does len(string) do?

A

» Returns the length of a string

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

What does string.find(str) do?

A

» Determines if str occurs in string
» Returns index if found
» Returns -1 otherwise

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

What does ord(“a”) do?

A

» In this case returns the integer value of a character
» 97 in this example

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

What does char(97) do?

A

» Returns the character represented by an integer

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

What is concatentation?

A

» Where you join 2 string together
» Do it by using + operator

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

What are the 5 string conversion operations?

A

» int()
» str()
» float()
» date()

17
Q

What are variables?

A

» Are identifiers given to memory locations whose contents will change during the course of the program

18
Q

What are constants?

A

» Values which never changes while the program is being run