fa
Feedback
Python Codes Basic to Advance

Python Codes Basic to Advance

رفتن به کانال در Telegram
2 813
مشترکین
اطلاعاتی وجود ندارد24 ساعت
-47 روز
-2430 روز
آرشیو پست ها
n = int(input("Enter num: ")) 
for i in range(n, 0, -1):
 print(" "* (n-i), end="")
 for j in range(i):
  print("*", end="")
 print()
""" Learn coding: https://t.me/addlist/2UhsQW_cGzkxMzg1
*****
 ****
  ***
   **
    *
"""

n = int(input("Enter num: ")) 
for i in range(n):
 print(" "* (n-i), end="")
 for j in range(i+1):
  print("*", end="")
 print()
""" Learn coding: https://t.me/addlist/2UhsQW_cGzkxMzg1
      *
     **
    ***
   ****
  *****
"""

# basic astrics triangle shape 2 pattern
n = int(input("Enter num: ")) 
for i in range(n, 0, -1):
    for j in range(i):
        print("*", end=" ")
    print()
""" Learn coding: https://t.me/addlist/2UhsQW_cGzkxMzg1
* * * * * 
* * * * 
* * * 
* * 
*
"""

# basic triangle shape pattern
n = int(input("Enter num: ")) 
for i in range(n):
 for j in range(i+1):
  print("*", end=" ")
 print()
""" P
* 
* * 
* * * 
* * * * 
* * * * *
"""

# basic astric's square shape pattern
n = int(input("Enter num: ")) 
for _ in range(n):
 for _ in range(n):
  print("*", end=" ")
 print()
""" P
* * * 
* * * 
* * *
"""

# basic pattern 2 without numbers
n = int(input("Enter num: ")) 
for _ in range(n):
    print("*", end= " ")
""" P
* * * * *
"""

# basic pattern in reverse
n = int(input("Enter num: ")) 
for i in range(n, 0, -1):
    print(i, end=" ")
# pattern # 6 5 4 3 2 1

n = int(input("Enter num: ")) 
for i in range(1,n+1):
 print(i, end=" ")
""" Learn coding: https://t.me/addlist/2UhsQW_cGzkxMzg1
1 2 3 4 5 6 7
"""

Starting Patterns

try this all one by one #python
try this all one by one #python

YouTube on Telegram 😎: http://t.me/YouTube_gbot/ytb

#python to copy text into clipboard Install playsound modules using pip install pyperclip
#python to copy text into clipboard Install playsound  modules  using pip install pyperclip

....Chatgpt on WhatsApp Yatter in.. Link :- https://wa.me/919811046549?text=Hi%20Yatter Join Coding: http://Telegram.me/addli
....Chatgpt on WhatsApp Yatter in.. Link :- https://wa.me/919811046549?text=Hi%20Yatter Join Coding: http://Telegram.me/addlist/2UhsQW_cGzkxMzg1

in this article, we will see how to use Python's Wikipedia API to fetch a variety of information from the Wikipedia website.
in this article, we will see how to use Python's Wikipedia API to fetch a variety of information from the Wikipedia website. Installation Wikipedia API. This can be done by entering the command below in your command prompt or terminal: $ pip install wikipedia # rest cheakout the code

# Events example in Python
class EventEmitter:
    def __init__(self):
        self.funcs = []
    
    def on(self, mesType, callback):
        self.funcs.append({'mesType': mesType, 'callback': callback})
    
    def emit(self, mesType, obj):
        for funobj in self.funcs:
            if funobj['mesType'] == mesType:
                funobj['callback'](obj)
# Now use of this EventEmitter class
e = EventEmitter()
def func(ob):
    print("Event message 1st listener: " + ob)

def func1(ob):
    print("Event message 2nd listener: " + ob)

def abcc(ob):
    print("Event abc listener: " + ob)

e.on('message', func)
e.on('message', func1)
e.on('abc', abcc)
# Emitting Events
mes = input('Enter anything for message Event: ')
e.emit('message', mes) # emitting message Event 

abc = input('\nEnter anything for abc Event: ')
e.emit('abc', abc) # emitting abc Event
# Share: Telegram.me/addlist/2UhsQW_cGzkxMzg1

guess the output? #python
guess the output? #python

#python music player Install playsound modules using pip install playsound in terminal give location of ur file in playsound(
#python music player Install playsound modules using pip install playsound in terminal give location of ur file in playsound(#path) Note:- \ is escape sequence character .

#Table using python of any number
num = int(input("Enter any number: "))
for i in range(1, 11):
    print(f"{num} * {i} = {num * i}")
# Join : @python_codes_pro

# 1 to 100 numbers
print(list(range(1, 101)))