Author: codertutor_3o6d0o

Python Date

Dates and Times For using dates and times you need to import the datetime module. There are two types of date and time objects: naive and aware. The objects that are timezone aware are the most used. Examples Extract date >>>...

Python String Pattern Matching

String Pattern Matching For using String Pattern Matching you need to import the re module. With the regular expressions from the re module you can process strings. Examples Extract from the string >>> import re >>> re.findall(r'\bp[a-z]*','learn fast python language') ['python']...

Python Read and Write Files

Read and Write Files For reading and writing files with Python, first you need to use open function, inside the open function set the path of the file and then set the mode of the file. The mode can be ‘r’...

Python Exception Handling

Exception Handling Exceptions occur during execution of a block when errors are detected and interrupt the normal execution of a code block. Python handle exceptions using the statement try…except, similar to the try…catch in Java. Examples Exception Handling using try except...

Python Functions

Built-in Functions This section shows python built-in functions, types and classes like: range, sum, len, list, str, set, input, hash, getattr, setattr, open, chr, dir, any, ord, exec. abs() all() any() bin() bool() chr() dir() enumerate() eval() hash() int() len() list()...