Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

While Loop with if else

c=0
while c < 10:
    if c!=5:
        print(c)
    else:
        print("FIVE")
    c+=1
Comment

While Loop with if else

while c < 10: c+=1; print(c) if c!=5 else print("FIVE")
Comment

PREVIOUS NEXT
Code Example
Python :: django many to many post update method via rest 
Python :: python check if string contains symbols 
Python :: python dictionary add item 
Python :: how to print text in python 
Python :: name is not defined python 
Python :: mean absolute error in machine learning formula 
Python :: how to run class.function from name python 
Python :: get time and dates string 
Python :: implement stack using list in python 
Python :: python create null matrix 
Python :: python tkinter 
Python :: python if in list 
Python :: zip() python 
Python :: delete from table django 
Python :: pyqt5 hide button 
Python :: how to sum all the values in a list in python 
Python :: if statement python explained 
Python :: open file in python network url 
Python :: negative slicing in python list 
Python :: pandas fillna multiple columns 
Python :: python append value to column 
Python :: python math packege power e 
Python :: upgrade python version windows 
Python :: create django object 
Python :: python how to restart thread 
Python :: python declare variable 
Python :: how to add element to list python 
Python :: interviewbit with Python questions solutions 
Python :: manytomany django add bulk create 
Python :: what is print in python 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =