1/19
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
String
A series of letters, numbers, or characters surrounded by quotation marks.
String Literal
Another word for string. "Hello" is a string literal.
Multiline Strings
A large amount of text with THREE sets of quotation marks at the beginning and end.
Methods
keywords which a program can use to modify data within a variable.
.lower( )
a string method that will cause all of the text to print lowercase. print(string_name.lower())
.upper( )
a string method that will cause oll of the text to pring in uppercase. print(string_name.upper())
.replace("cool" , "fun" )
a string method that will switch all instances of "cool" with the string "fun". print(string_name.replace( “cool“, “fun“)
.strip( )
a string method used to remove any excess white space at the beginning and end of a string.
print(string_name.strip())
Index Number
Measures what position a character or item is in the sequence. Indexing begins counting at zero.
slice( int start(inclusive), int end(exclusive))
A string method that uses indexes to print out specific parts or "slices" of a string. sub = slice (3,6)
print(string_name[sub])
.split( )
A string method that will separate or "split" a string into a list.

len( )
A string method that returns how many characters the string is long.
.find( )
A string method that returns the index value of a certain character in a string.
print(string_name.find(“T“))
.rfind( )
Find the last instance of a substring in a string

Concatenate
To join strings together
Application Programming Interface(API)
The set of rules the language follows to interact with other programs. The API also lists all methods in the language, and how they function
startswith(string)
returns true if the string starts with the argument
endswith(string)
returns true of the string ends with the argument
charAt(int)
returns the character at index value
title()
returns a new string with all first characters of words capitalised, and every other character in lowercase