Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

inverted trapezium pattern in python

n=int(input())
l=[];c=1
for i in range(n,0,-1):
    temp=[j for j in range(c,c+i)]
    l.append(temp)
    c+=i
l=l[::-1]
for i in range(1,n+1):
    temp=['-' for j in range(n-i)]
    temp+=l[i-1]
    temp+=[j for j in range(c,c+i)]
    print(*temp)
    c+=i# Published By PKJCODERS
Comment

PREVIOUS NEXT
Code Example
Python :: caqch làm app chatbot python 
Python :: seeparate string without split function python 
Python :: __pycache__ 
Python :: text to qr code python 
Python :: python merge two byte files 
Python :: (Word or Phrase to Phone-Number Generator) python 
Python :: python get_loc not returning number 
Python :: ex: python arraay 
Python :: Reason: "broken data stream when reading image file" in jupyter notebook 
Python :: django.db.utils.IntegrityError: column contains null values 
Python :: python pipe where 
Python :: python generate sine wave pyaudio 
Python :: max sum slice python 5 - autopilot 
Python :: context manager requests python 
Python :: running mean 
Python :: how to import the whall library in python 
Python :: python redirect console output to devnull 
Python :: convert from python code to c++ code 
Python :: python heroku 
Python :: python range for loop 
Python :: inverting a dictionary 
Python :: np.random.choice replace 
Python :: format python decimal 
Python :: how to make an error message in python 
Python :: true in python 
Python :: python serial port 
Python :: py scrapy 
Python :: def is_leap(year): leap = False 
Python :: how to make capitalize text in python 
Python :: setdefault python 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =