2.2 Programming Fundamentals Flashcards

1
Q

What is string manipulation?

A

Using programming techniques to modify, analyse or extract information from a string.

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

What are five examples of string manipulation?
Give the type of string manipulation each one is.

A

Case conversion (modify)
Length (analyse)
Substrings (extract)
Concatenation (modify)
ASCII conversion (analyse)

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

What is the difference between between a character and a string?

A

Character - single character (A) (%)
String - sequence of characters (“Hello world!”)

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

What is casting?

A

Converting one data type to another.

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

What is case conversion?

A

Changing a string from one case to another.

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

What is substring?

A

Extracting a sequence of characters from a larger string.

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

What is concatenation?

A

Joining two or more strings together.

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

What is ASCII conversion?

A

Returning an ASCII character from a numerical value.

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

What is the code for case conversion, upper case?

A

print(Name.upper())

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

What is the code for extracting length?

A

print(len(Password))

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

What is the code for a substring?

A

string[start character : end character]

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

What is the code for concatenation?

A

FullName = FName + SName

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

What is the code for ASCII conversion for a letter?

A

print(chr(97))

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

What is the code for ASCII conversion for a number?

A

print(ord(“A”))

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

What type of iteration is a while loop?

A

Conditional iteration

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

True or False? A while loop is counted iteration.

17
Q

True or False? A while loop is conditional iteration.