Machine Learning Tutorial Python : 13. Python For Loop

Veröffentlicht am: 21 Februar 2019
auf dem Kanal: Vinoth QA Academy
1,262
16

#vision2020 #aiforeveryone #python :

"My Vision is to provide "AIFOREVERYONE", by creating free video courses for Artificial Intelligence ,
Machine Learning, Deep Learning and Data Science Aspirants!"

If you wish to support my #vision2020, kindly Like, Subscribe & Share this knowledge to your friends and colleagues.

Follow Me :

Materials: https://aiforevery1.com/numpy/

Udemy : https://www.udemy.com/user/vinoth-rat...

LinkedIn :   / vinothrathinamautomation  

Facebook :   / aiforevery1  

Github : https://github.com/vinothrwins

************************************************************
Playlist:

Artificial Intelligence for Beginners :    • Playlist  

Python for Artificial Intelligence :    • Python for Artificial Intelligence(Data Sc...  

Mathematics for Artificial Intelligence :    • Mathematics for Artificial Intelligence  

Python NumPy for Artificial Intelligence :    • Python NumPy for Artificial Intelligence  

Data Science Process :    • Playlist  

***********************************************************
Agenda :

What is For loop?
For loop with else statement
Looping through String
Range Function
Iterating by Sequence Index
Nested For Loop
12 Sample programs

***************************
Python Loops
***************************

A loop statement allows us to execute a statement or group of statements multiple times.

Python has two primitive loop commands:
• while loops
• for loops

***********
For Loop
***********

The for loop in Python is used to iterate over a sequence (list, tuple, string) or other iterable objects.
Iterating over a sequence is called traversal

***********
Syntax :
***********

for iterating_var in sequence:
statements(s)

The first item in the sequence is assigned to the iterating variable iterating_var.
Next, the statements block is executed. Each item in the list is assigned to iterating_var, and the statement(s) block is executed until the entire sequence is exhausted

********************************
Using else Statement with Loops
********************************

If the else statement is used with a for loop, the else statement is executed when the loop has exhausted iterating the list

**********************
The range() function
**********************

We can generate a sequence of numbers using range() function.
We can also define the start, stop and step size as range(start,stop,step size). step size defaults to 1 if not provided.
This function does not store all the values in memory, it would be inefficient. So it remembers the start, stop, step size and generates the next number on the go.

****************************
Iterating by Sequence Index
****************************

An alternative way of iterating through each item is by index offset into the sequence itself.

****************
Nested For Loop
****************

Python programming language allows to use one for loop inside another for loop

************************************************************
Kindly let me know your feedback for improvement purpose. Feel free to correct any mistakes in case !!

Happy Learning,
Vinoth Rathinam


Auf dieser Seite können Sie das Online-Video Machine Learning Tutorial Python : 13. Python For Loop mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Vinoth QA Academy 21 Februar 2019 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,262 Mal angesehen und es wurde von 16 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!