Skip to content

Latest commit

 

History

History
6 lines (4 loc) · 674 Bytes

string_methods.md

File metadata and controls

6 lines (4 loc) · 674 Bytes

String methods

TODO: ADD MORE

  • strings (and other types) have built in instance methods - in this case, "string".startswith("s") which are called from the instance of the string itself phone-number
  • this exercise uses str.maketrans() (a static method of str that returns a dictionary to create a translation table as required by the str.translate() instance method. This method is unusual in that it takes either a single dictionary or two strings of equal length. The example solution for this exercise uses str.maketrans() with a two-string argument. rna-transcription