Python Modules What is a Module?¶Consider a module to be the same as a code library. A file containing a set of functions you want to include in your application. Create a Module¶ To create a module just save the code you want in a file with the file extension …
Read More »Python Functions
Python Functions Python Function¶ A function is a block of code which only runs when it is called. You can pass data, known as parameters, into a function. A function can return data as a resul A colon (:) to mark the end of the function header. An optional return …
Read More »Python Sets
Python Sets Python Set¶A set is an unordered collection of items. Every set element is unique (no duplicates) and must be immutable (cannot be changed). Sets are used to store multiple items in a single variable. Set is one of 4 built-in data types in Python used to store collections …
Read More »Python Dictionary
Python Dictionary Python Dictionary¶Dictionaries are used to store data values in key:value pairs. A dictionary is a collection which is ordered*, changeable and does not allow duplicates. Dictionaries are written with curly brackets, and have keys and values: {‘Key’:’Value’} Note:As of Python version 3.7, dictionaries are ordered. In Python 3.6 …
Read More »Python Tuples
Python Tuple Python Tuples¶Tuples are used to store multiple items in a single variable. Tuple is one of 4 built-in data types in Python used to store collections of data, the other 3 are List, Set, and Dictionary, all with different qualities and usage. A tuple is a collection which …
Read More »Python Lists
Python List Python Lists¶Lists are used to store multiple items in a single variable. Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are Tuple, Set, and Dictionary, all with different qualities and usage. Lists are created using square brackets: …
Read More »Python Strings
String in Python Strings in Python : MachineLearning.org.in¶Strings are used in Python to record text information, such as name. Strings in Python are actually a sequence, which basically means Python keeps track of every element in the string as a sequence. For example, Python understands the string “hello’ to be …
Read More »Python Numbers
Python Numbers Python Numbes¶Number data types store numeric values. They are immutable data types, means that changing the value of a number data type results in a newly allocated object. Python supports four different numerical types −¶ int long float complex In [1]: x = 10 # int y = 3.28 …
Read More »Python Loops
4 Looping Statement Python Loops¶Python has two primitive loop commands: for loops while loops For Loop¶A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string). In [1]: L=[10,20,"Machine Learning",40,50] for i in L: print("Printing",i) Printing 10 Printing …
Read More »Python Decision Making
Task 1 – Conditional Statements Python Decision Making¶Python supports the usual logical conditions from mathematics:¶ Equals: a == b Not Equals: a != b Less than: a < b Less than or equal to: a <= b Greater than: a > b Greater than or equal to: a >= b …
Read More »
Machine Learning Tutorials, Courses and Certifications