#23 Python Tutorial for Beginners | Printing Patterns in Python
HTML-код
- Опубликовано: 15 сен 2024
- Check out our courses:
Spring Framework 8 Full-Day Course Live: go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Enterprise Java Spring Microservices: go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : go.telusko.com...
Coupon: TELUSKO20 (20% Discount)
Udemy Courses:
Spring: go.telusko.com...
Java:- go.telusko.com...
Java Spring:- go.telusko.com...
Java For Programmers:- go.telusko.com...
Python : go.telusko.com...
Git : go.telusko.com...
Docker : go.telusko.com...
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusk...
Instagram : / navinreddyofficial
Linkedin : / navinreddy20
TELUSKO Android App : bit.ly/TeluskoApp
In this lecture we will learn:
- How to implement the logic for pattern printing?
- Pattern printing through python
- Print the pattern of a square
- Print the pattern of the right triangle and reverse right-triangle
- Different approaches to printing a pattern
#1
- Pattern printing improves logical thinking capability.
- Programming is all about solving the problem, we have to understand the problem statement and wrote code for it.
- A pattern can be printed in many ways.
- We can print multiple hashes(#) in a single statement as a string.
- If you are allowed to print only hash in a statement at a time, then you have to write the same print statement multiple times.
- On writing a statement multiple times, it will give an output in a column.
- To convert a column output into a row format, we can use the end=" "parameter in every statement.
- To will restrict the cursor to move on a new line and hashes(#) will be printed in a single row.
#2
- Instead of writing the same code multiple times, we can use a for a loop.
- For a range(n) in a for loop, it will start from 0 and end at (n-1).
- We can use two loops, for printing two rows separated by a new line.
- For printing multiple rows, we have to write the same for loop code repeatedly.
- So, we can write the above for loop block inside another outer loop.
- In nested loops, an outer loop contains a variable that represents the number of rows and an inner loop contains a variable that represents the number of columns.
#3
- We can apply the concept to different patterns in a similar way.
e.g., for printing a right -triangle, we can restrict the inner loop till the value of a number of rows.
- For the reverse of the right triangle, we can restrict the inner loop till (n-i), where i is the number of rows.
Python Tutorial to learn Python programming with examples
Complete Python Tutorial for Beginners Playlist : • #1 Python Tutorial for...
Python Tutorial in Hindi : • #1 Python Tutorial | I...
Github :- github.com/nav...
In this video we will see:
- Printing patterns
- Using loop
- For loop
Python for Beginners :- bit.ly/3JOLQhl
Editing Monitors :
amzn.to/2RfKWgL
amzn.to/2Q665JW
amzn.to/2OUP21a.
Editing Laptop :
ASUS ROG Strix - (new version) amzn.to/2RhumwO
Camera : amzn.to/2OR56AV
lens : amzn.to/2JihtQo
Mics
amzn.to/2RlIe9F
amzn.to/2yDkx5F
Java:- bit.ly/JavaUde...
Spring:- bit.ly/SpringU...
More Learning :
Java :- bit.ly/3x6rr0N
Python :- bit.ly/3GRc7JX
Django :- bit.ly/3MmoJK6
JavaScript :- bit.ly/3tiAlHo
Node JS :- bit.ly/3GT4liq
Rest Api :-bit.ly/3MjhZwt
Servlet :- bit.ly/3Q7eA7k
Spring Framework :- bit.ly/3xi7buh
Design Patterns in Java :- bit.ly/3MocXiq
Docker :- bit.ly/3xjWzLA
Blockchain Tutorial :- bit.ly/3NSbOkc
Corda Tutorial:- bit.ly/3thbUKa
Hyperledger Fabric :- bit.ly/38RZCRB
NoSQL Tutorial :- bit.ly/3aJpRuc
Mysql Tutorial :- bit.ly/3thpr4L
Data Structures using Java :- bit.ly/3MuJa7S
Git Tutorial :- bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
www.telusko.com