pattern in python
rows = 6 #Pattern(1,121,12321,1234321,123454321)
for i in range(1, rows + 1):
for j in range(1, i - 1):
print(j, end=" ")
for j in range(i - 1, 0, -1):
print(j, end=" ")
print()
pattern in python
rows = 6 #Pattern(1,121,12321,1234321,123454321)
for i in range(1, rows + 1):
for j in range(1, i - 1):
print(j, end=" ")
for j in range(i - 1, 0, -1):
print(j, end=" ")
print()
pyramid pattern in python
n = 3
for i in range(1, n+1):
print(f"{' '*(n-i)}{' *'*i}"[1:])
# Output:
# *
# * *
#* * *
* pattern by python
def pattern(n):
for i in range(0,n):
for j in range(0, i+1):
print("* " , end="")
print("\r") pattern(5
python pyramid
# install pyramid (basic, if path is not set yet)
py -m pip install pyramid
# or set PATH to use pip:
setx PATH "%PATH%;C:\<path\to\python\directory\>\Scripts"
pip install pyramid
# or
pip3 install pyramid --upgrade
# if "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed" [!]:
py -m pip install --trusted-host pypi.python.org pip pyramid
# if PermissionError: [WinError 5] Access is denied
py -m pip install --user pyramid
# or via creating a virtual environment venv:
py -m venv c:\path\to\new\environment
# then execute:
c:\path\to\new\environment\Scripts\activate.bat
python def
#Use this to shortern a task that you may want to repeat
#Used for making custom commands
def paste(a, b)
for i in b:
print(a)
while True:
paste("Python is Cool!!!", 3)
#Output:
#Python is Cool!!!
#Python is Cool!!!
#Python is Cool!!!
## - ANOTHER EXAMPLE - ##
happy = "NEUTRAL"
def yes():
happy="TRUE"
print("Thank you!")
def no():
happy="FALSE"
print("That's not nice!")
answer=str(input("Do you like my new shoes? (y/n) ")
if answer=="yes" or "y" or "Yes" or "Y" or "YES":
yes()
elif answer=="no" or "n" or "No" or "N" or "NO":
no()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us