jagomart
digital resources
picture1_Python Pdf 186512 | 11b Regexp


 132x       Filetype PDF       File size 0.23 MB       Source: homes.cs.washington.edu


File: Python Pdf 186512 | 11b Regexp
lecture 11b regular expressions thanks to mary kuhner for many slides 1 using objects and classes a class is a variable type with associated functions an object is an instance ...

icon picture PDF Filetype PDF | Posted on 02 Feb 2023 | 2 years ago
Partial capture of text on file.
        Lecture 11b - Regular Expressions
        Thanks to Mary Kuhner for many slides
                                                                              1
       Using objects and classes
       • A class is a variable type with associated functions
       • An object is an instance of a class
       • We have already used the string class
       • String offers functions such as upper(), lower(), and find()
       • In this lecture we’ll use classes; Thursday we’ll create some
                                                                2
       Using an object
       mystring = "ATCCGCG"
       print mystring.find("C")
       2   # position of first "C"
       print mystring.count("C")
       3
                                                                   3
        Regular Expressions
         • Regular expressions (regexp) are a text-matching tool embedded in
           Python
         • They are useful in creating string searches and string modifications
         • You can always use regular Python instead, but regexps are often much
           easier
         • Documentation: http://docs.python.org/library/re.html
                                                                                4
The words contained in this file might help you see if this file matches what you are looking for:

...Lecture b regular expressions thanks to mary kuhner for many slides using objects and classes a class is variable type with associated functions an object instance of we have already used the string oers such as upper lower nd in this ll use thursday create some mystring atccgcg print find c position first count regexp are text matching tool embedded python they useful creating searches modications you can always instead but regexps often much easier documentation http docs org library re html...

no reviews yet
Please Login to review.