Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary Python Guide 2

Rating
-
Sold
-
Pages
14
Uploaded on
28-04-2023
Written in
2022/2023

This document gives a basic idea of few of the python topics & is continuation to the previous part released by me.

Institution
Course

Content preview

Python Language Notes Part-2
While Loop in Python
Python is a programming language that allows you to repeat
the same state with multiple times. the best way to do it is
applying a loop is to apply a loop.. Python is an easy way to
use loops and we can use to debauch loops. One is palace of
wild lupine seconds for less for loop. every time you print a
disco just increment the value of I just incrementing the value
so you will say I is equal to I plus 1 that 's it it 's so simple and
remove the syntax so we have to use a while the negative
specify the condition and a colon. Now this kunis specify
whatever is coming our head is a part of this block. if I say f8
now it will come out and that 's why you got five times the
disco right so these are you can. Use while loop. there are
three things important. Here one assign the value then
condition and then increment or decrement. before executing
this you try to guess the output..

For Loop in Python
Python is optional in Python so print only when it is not equal
right so we can do that. In the next video we 'll play with some
patterns. You know we'll try the dorsum patterns. the next
video will be fun so I hope you are enjoying the series. It
means the comment section and Dukey like Button..


Break Continue Pass in Python
Python is a programming language that uses loops and a while
loop in Python. The code is designed to mimic a vending
machine in order to mimic the vending machine. Python uses a
variable which is increment variable and the value for this
variable will be coming from user input. After every statement
we need to also increment it in fact we can so if you can write I
equal to I plus 1 or you can use shortcut I plus equal equal to
1. is what game are you says hey I want 100 candies okay and
then in your machine in the vending machine we do n't have
hundred candies you have let 's say fifty candies or maybe 80
candles so what you will do now you have two choice you can
stop the transaction you can say hey user we don't have so

, many candies all what you can do is you can give 80 candies. If
the value of I is greater than your number of available candies
which is a B in that case you will stop the execution. If you
want to print a message by saying hey we are tough now we
can do that here so you can say print out above stock and now
I feel on this code let 's say I want I want eight candies you can
see after printing five candidates saying out of stock. You can
use it in your in your applications but then this is how it works.

It will skip only those values which are divisible by both in the
assignment question it was 3 or 5 right so we can do we can
say odd I mod 5 is equal to equal to 0 in that case I do I just
want to skip the remaining statements okay when I say the
meaning statement I don't skip the statement outside the loop
example. The next video will be very exciting where we talk
about different patterns so I hope you enjoyed this series let
me know in the comment section. In the next video we 'll talk
about some more patterns since we have talked about this
thing now this so I will say in else you have to print this so if I
mod 2 is not equal to 0 then don't do it but only if it is in in in
the else condition I want to print it.

In programming, there are two different types of code that are
used: break continued and pass. When break continued is
used, it will skip the limiting statement and will go back to the
next iteration. Meanwhile, continue will skip that statement.
Pass is pass now again, so there is no compile time issue the
moment you remove this statement. However, if you want to
keep a function empty, you will use pass. Similarly, if you have
an if condition in a for loop, and you specify a condition, then if
and will say if y is equal to four. However, if you don't specify a
condition, then if will say if y is equal to anything. So far in this
video, we've looked at break continued and pass. In the next
video, we'll look at another code type: return.


Printing Patterns in Python
Devin Wendy and Devin Wendy continue series on Python. In
this video we 'll try to do some patterns so that it will improve
the way you think programming is all about solving a problem
right so you have to understand the problem statement and
put that in a code so mentally in your mind you 'll be having
those solutions ready. I want to use a loop and I will be using a

Written for

Course

Document information

Uploaded on
April 28, 2023
Number of pages
14
Written in
2022/2023
Type
SUMMARY

Subjects

$10.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
ksaikumar0510

Also available in package deal

Get to know the seller

Seller avatar
ksaikumar0510 Indian Institute of Chartered Accountancy
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
4
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions