Category: Python

Python Dictionaries

Dictionaries The Python data type dictionary is an unordered set of keys and values. The values can be searched using the keys, which can be any immutable type; strings and numbers can always be keys. Examples Extract values from a dictionary...

Python Define Function

Define Function How to define an function in Python language ? The simple way to write a function is to use def keyword, then write de function name, and inside function use the return keyword to print the output of the...

Python Define Class

Define Class How to define a class in Python language ? First you need to know that a class is an object type created by executing a class statement. The simple way to write a class is to use class keyword,...

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']...