--> While- Else- Python- Alpha Codist | Alpha Codist

Search This Blog

While- Else- Python- Alpha Codist

While-else is used to create loops, programming, java, software, PHP, C programming, programming languages, Alpha Codist, Perl, XML program, UNIX

While-else is used to create loops. When you want to run a code multiple times or run a piece of code for a long time you will need to use a loop and this is where "While loop" does the job. Bellow, there is given a short example where while is used to print a sentence (Follow Alpha Codist on Facebook, Instagram, Twitter.) multiple (4) times. And the liked variable was used to break the code. 1 is added with liked every single time the loop runs and when it goes from 0 to 3 the code stays true and the loop runs but when liked gets equal to the loop breaks and the sentence in else is printed.

Example:

 
While-else is used to create loops, programming, java, software, PHP, C programming, programming languages, Alpha Codist, Perl, XML program, UNIX
While loop

love_programing = True
liked = 0

while love_programing and liked <= 3:
    print("Follow Alpha Codist on Facebook, Instagram, Twitter.")

    liked += 1

else:
    print("I followed Alpha Codists all social pages.")

Result:

While-else is used to create loops, programming, java, software, PHP, C programming, programming languages, Alpha Codist, Perl, XML program, UNIX

While-else is used to create loops, programming, java, software, PHP, C programming, programming languages, Alpha Codist, Perl, XML program, UNIX


COMMENTS

Name

beeCrowd,11,C,10,Computer,9,Downloads,3,HTML,1,My Creation,2,Python,24,Python-Soft,1,Shooting,2,
ltr
item
Alpha Codist: While- Else- Python- Alpha Codist
While- Else- Python- Alpha Codist
While-else is used to create loops, programming, java, software, PHP, C programming, programming languages, Alpha Codist, Perl, XML program, UNIX
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWRExMdk5Fl2MlEbJy8kHRS1Rx1DHPfUqI2DE7VJTqTdJZhjLYkBKRkKhE5s4YFnrBfGkbTwBwj7uPyuQBxkKOP9PgQBJspVLr2pRL6-r5vZFauyhjydmggCen1tPy4OfmECszEdvwEVO_/w640-h422/While+loop-01.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWRExMdk5Fl2MlEbJy8kHRS1Rx1DHPfUqI2DE7VJTqTdJZhjLYkBKRkKhE5s4YFnrBfGkbTwBwj7uPyuQBxkKOP9PgQBJspVLr2pRL6-r5vZFauyhjydmggCen1tPy4OfmECszEdvwEVO_/s72-w640-c-h422/While+loop-01.png
Alpha Codist
https://alphacodist.blogspot.com/2020/07/while-else-python-alpha-codist.html
https://alphacodist.blogspot.com/
https://alphacodist.blogspot.com/
https://alphacodist.blogspot.com/2020/07/while-else-python-alpha-codist.html
true
7547834254111195316
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content