Python programming codes
43 subscribers
25 photos
1 video
83 files
82 links
Uploading All programming codes are updating Daily
ask doubts in comment box 🎁☑️
Download Telegram
#nested_loop_example_3 :
""" To print reverse all columns and rows - 1 with star pattren

i is row and j is column"""

#method_1


#method_2 (shortcut method)
for i in range(5):
print(" "*i,"* "*(5-i))
#nested_loop_example_4 :
""" To print left half pyramid with star pattren program

i is row and j is column"""

#method_1


#method_2 (shortcut method)
n = int(input("Enter the value: "))
for i in range(n):
print(" "*(n-(i+1)),"* "*(i+1))
everyone can respond my post any one reaction or comment of every post
admin of this channel @itsmekriish
Python programming codes pinned «everyone can respond my post any one reaction or comment of every post admin of this channel @itsmekriish»
#Create note book with python code
import tkinter as tk
from tkinter import filedialog

class Notepad(tk.Tk):
def init(self, *args, **kwargs):
tk.Tk.init(self, *args, **kwargs)

# Set the title for the notepad
self.title("Notepad")

# Create a text widget
self.text = tk.Text(self, wrap="word")
self.text.pack(side="top", fill="both", expand=True)

# Create a menu bar
self.menu = tk.Menu(self)
self.config(menu=self.menu)

# Create a file menu
file_menu = tk.Menu(self.menu)
self.menu.add_cascade(label="File", menu=file_menu)
file_menu.add_command(label="New", command=self.new_file)
file_menu.add_command(label="Open", command=self.open_file)
file_menu.add_command(label="Save", command=self.save_file)
file_menu.add_separator()
file_menu.add_command(label="Exit", command=self.quit)

# Create an edit menu
edit_menu = tk.Menu(self.menu)
self.menu.add_cascade(label="Edit", menu=edit_menu)
edit_menu.add_command(label="Cut", command=self.cut)
edit_menu.add_command(label="Copy", command=self.copy)
edit_menu.add_command(label="Paste", command=self.paste)

def new_file(self):
self.text.delete("1.0", "end")
self.title("Notepad")

def open_file(self):
file = filedialog.askopenfile(parent=self, mode="rb", title="Open a file")
if file:
contents = file.read()
self.text.delete("1.0", "end")
self.text.insert("1.0", contents)
file.close()
self.title(file.name + " - Notepad")

def save_file(self):
file = filedialog.asksaveasfile(mode="w", defaultextension=".txt", filetypes=[("Text Documents", "*.txt"), ("All Files", "*.*")])
if file:
contents = self.text.get("1.0", "end")
file.write(contents)
file.close()
self.title(file.name + " - Notepad")

def cut(self):
self.text.event_generate("<<Cut>>")

def copy(self):
self.text.event_generate("<<Copy>>")

def paste(self):
self.text.event_generate("<<Paste>>")

if name == "main":
notepad = Notepad()
notepad.mainloop()
how Many peoples active this channel
Anonymous Quiz
100%
active
0%
inactive
def myfunc(num):
if num%2==0:
return True else: return False print(myfunc(4))
Anonymous Quiz
29%
2
57%
True
0%
False
14%
Error
import math
print(abs(math.sqrt(25)))
Anonymous Quiz
50%
5
0%
25**25
25%
Error
25%
5.0
x=15
if x/2<2:
print(True) else: print(False)
Anonymous Quiz
50%
True
50%
False
Java script notes
Forwarded from SMW Services
JavaScript Notes.pdf
33.1 MB
Java script notes 2023
#reverse number

#while_loop
n = int(input("enter the value: "))

rev = 0

while n != 0:
rem = n%10
rev = rev*10 + rem
n = n//10
print("Reverse number",rev)
#sum of digits

#while_loop

n = int(input("enyer the value : "))

sum = 0
while n != 0:
rem = n%10
sum += rem
n = n//10

print("sum of digits",sum)
#HANUMAN

from colorama import Fore

#H letter
for i in range(7):
for j in range(5):
if i in {0,1,2,3,4,5,6} and j in {0,4} or i in {3} and j in {1,2,3}:
print(Fore.BLUE+"*",end=" ")
else:
print(" ",end=" ")
print()

print()

#A
for i in range(7):
for j in range(5):
if i in {1,2,3,4,5,6} and j in {0,4} or i in {0,3} and j in {1,2,3}:
print(Fore.RED+"*",end=" ")
else:
print(" ",end=" ")
print()

print()

#N
for i in range(7):
for j in range(7):
if i in {0,1,2,3,4,5,6} and j in {0,6} or i==j :
print(Fore.YELLOW+"*",end=" ")
else:
print(" ",end=" ")
print()

print()

#U
for i in range(7):
for j in range(6):
if i in {0,1,2,3,4} and j in {0,5} or i in {5} and j in {1,2,3,4} :
print(Fore.GREEN+"*",end=" ")
else:
print(" ",end=" ")
print()

print()

#M
for i in range(7):
for j in range(7):
if i in {0,1,2,3,4,5,6} and j in {0,6} or i in {1} and j in {1,5} or i in {2} and j in {2,4} or i in {3} and j in {3} :
print(Fore.MAGENTA+"*",end=" ")
else:
print(" ",end=" ")
print()

print()

#A
for i in range(7):
for j in range(5):
if i in {1,2,3,4,5,6} and j in {0,4} or i in {0,3} and j in {1,2,3} :
print(Fore.CYAN+"*",end=" ")
else:
print(" ",end=" ")
print()

print()


#N
for i in range(7):
for j in range(7):
if i in {0,1,2,3,4,5,6} and j in {0,6} or i==j:
print(Fore.WHITE+"*",end=" ")
else:
print(" ",end=" ")
print()

#to see the output and comment that output
Python programming codes pinned «#HANUMAN from colorama import Fore #H letter for i in range(7): for j in range(5): if i in {0,1,2,3,4,5,6} and j in {0,4} or i in {3} and j in {1,2,3}: print(Fore.BLUE+"*",end=" ") else: print(" ",end=" ") …»