Chapter 4 Flashcards
Data is….
Information
Character
A single character
String
A list of characters
A strongly typed language is….
You must STATE THE VARIABLE TYPE when creating a variable
What is a weakly typed programming language.
The language guesses what data type should be used
Counts how many characters eg. ***(orange) -> 6
Len(string)
‘orange’.**() -> Orange
String.capitilize()
‘BanAna’.*****() - banana
String.lower()
‘Banana’.*****() - BANANA
String.upper()
Moves to the right eg. ‘Dog’.*****(50) - Dog
String.rjust(number)
‘Dog’.****(‘o’,’i’) - dig
String.replace(oldvalue, newvalue))
Splits into list eg. ‘Myname’.*****(‘y’) - [‘my,’name’]
String.split(separator)
Remove characters from the beginning and the end of the string.
String.strip(chatacters)
Converts a list into string where each item in the list is joined by that string. Eg.
‘+’.**([‘Bill’,’Barney’,Ben’)] ——> Bill+Barney+Ben
String.join(list)
Locates the index position of the first character of the substring. Eg.
‘The missing word’.**(‘miss’) —> 4
String.find(substrings)
Changes items in a string eg.
“My name is {name} and I am {age} years old.”.****(name = Bob, age = ‘27’) —> My name is bob and I am 27 years old
String.format(items)
Newline
\n
Tab
\t
\”
Print quote mark
\\
Print backslash
Concatenation is a fancy word for…
Combining strings and lists.
Element
An item of data
An array
A variable that contains many items of data
A static array
Defined, unchangeable size
Dynamic array
Size can change
Record
A collection of data about a particular subject
A database
A structured and managed set of data held on a computer
Table
A sheet of data in a database
Field
An item of information expressed as a column in a table
Entry
A record of data elements expressed as rows of a table
Cell
An Item of data in a table
SQL - *
Wildcard selects all fields
SQL layout
Select : the data you are interested in
From : the table you are interested in
Where : the condition you are interested in