Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python pattern of 1010101

"""
1 0 1 0 1 0 1 
  1 0 1 0 1 
    1 0 1 
      1 
"""
n = 4
for i in range(n):
    for j in range(i+1):
        print(" ",end=" ")
    for k in range(2 * (n - i) - 1):
        if k%2==0:
            print("1", end=" ")
        else:
            print("0",end=" ")
    print()
Comment

PREVIOUS NEXT
Code Example
Python :: how to use python telegram filters 
Python :: Use PIP from inside script 
Python :: Remove Brackets from List Using join method with loop 
Python :: call a Python range() using range(start, stop) 
Python :: bouton 
Python :: tuple python !g 
Python :: make dialog in the front by Pywinauto 
Python :: How to set a tkinter window to a constant size 
Python :: python raw strings 
Python :: find smallest element not present in list python 
Python :: create multiple marks python for python 
Python :: python readlines  
Python :: empty list 
Python :: python list len 
Python :: python pyramid pattern 
Python :: Creating 2-dimesional array 
Python :: find middle permutation of the string in python list 
Python :: patterns and matcher nfa python code 
Python :: ring Copy Lists 
Python :: qtextedit insert unicode 
Python :: rpi python read spi 
Python :: pairplot seaborn legend best position set 
Python :: How to make exit button? 
Python :: global variable not accessible withing thread 
Python :: y level for iron 
Python :: python class overwrite length method 
Python :: django amzon like app 
Python :: easygui text adventure in python 3 
Python :: "How to get the remainder of a number when dividing in python" 
Python :: sleep python 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =