Back
Close

Beginner Python Concepts

a-Rye
25.7K views

Loop Examples

It's helpful to see a few of the ways we would want to use these concepts.

So, this bit of code here:

This is written out, verbatum, what is going on in loop logic

Can be simplified with using loops, like so:

Much more compact code

Another nifty thing you can accomplish with a bit of loop logic and Python keyword shortcuts:

This is some basic pattern matching
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io