2.2 Programming Fundamentals Flashcards
What is string manipulation?
Using programming techniques to modify, analyse or extract information from a string.
What are five examples of string manipulation?
Give the type of string manipulation each one is.
Case conversion (modify)
Length (analyse)
Substrings (extract)
Concatenation (modify)
ASCII conversion (analyse)
What is the difference between between a character and a string?
Character - single character (A) (%)
String - sequence of characters (“Hello world!”)
What is casting?
Converting one data type to another.
What is case conversion?
Changing a string from one case to another.
What is substring?
Extracting a sequence of characters from a larger string.
What is concatenation?
Joining two or more strings together.
What is ASCII conversion?
Returning an ASCII character from a numerical value.
What is the code for case conversion, upper case?
print(Name.upper())
What is the code for extracting length?
print(len(Password))
What is the code for a substring?
string[start character : end character]
What is the code for concatenation?
FullName = FName + SName
What is the code for ASCII conversion for a letter?
print(chr(97))
What is the code for ASCII conversion for a number?
print(ord(“A”))
What type of iteration is a while loop?
Conditional iteration
True or False? A while loop is counted iteration.
False
True or False? A while loop is conditional iteration.
True