everyone can respond my post any one reaction or comment of every post
admin of this channel @itsmekriish
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()
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()
def myfunc(num):
if num%2==0:
return True else: return False print(myfunc(4))
if num%2==0:
return True else: return False print(myfunc(4))
Anonymous Quiz
29%
2
57%
True
0%
False
14%
Error
mimo app coding 😊 fun 🎯game join and let's friendly
https://getmimo.com/invite/erhmjm
https://getmimo.com/invite/erhmjm
App Store
Mimo: Learn Coding/Programming
Learning to code has never been so easy!
Advance your career, build apps and websites, or even become a developer. Mimo makes learning to code and diving into computer science as intuitive and easy as possible so that everyone can learn to code - the skill…
Advance your career, build apps and websites, or even become a developer. Mimo makes learning to code and diving into computer science as intuitive and easy as possible so that everyone can learn to code - the skill…
Join me on Sololearn — the fun, free way to get tech skills in just 5 mins a day!
https://sololearn.onelink.me/MfgO/p6s69yq0
https://sololearn.onelink.me/MfgO/p6s69yq0
App Store
Sololearn: Learn to Code Apps
Sololearn has the world's largest collection of FREE programming courses to learn how to code. Learn Python, C++, JavaScript, Java, jQuery, machine learning, data science, and more. You receive a certificate for each course that you complete. Choose from…
#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)
#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)
#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
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=" ") …»
What type of error is shown when you use a variable without assigning an initial value?
Anonymous Quiz
18%
Not assigned
27%
Not declared
55%
Not defined
0%
Not a variable
What will be the output after the following statements?
a = 15
b = a a = 25 print(a,b)
a = 15
b = a a = 25 print(a,b)
Anonymous Quiz
0%
a 15
58%
25 15
0%
25 a
42%
15 25