January 31, 2021

Create button using tkinter python

 









from tkinter import *

obj=Tk()

def name():

    print ("ajay pandit")


def profilepic():

    root=Tk()

    root.geometry("0x0")

    root.title("ajay pandit")

    photo=PhotoImage(file="4.png")

    aj=Label(image=photo)

    aj.pack()

    root.mainloop()


def aboutus():

    print('''\n\n

The computer science engineer

expert on programming(c,c++,java,python,html,css,sql)

certified ethical hacker''')


def contactus():

    print('''\n\n

phonr no. : 0123456789

email : ajayoneness123@gmail.com

instagram.com/hacking_knowledge

www.codeajay.blogspot.com

fb.com/hackingknowledge''')

obj.geometry("500x900")

f1 =Frame(obj,bg="green",borderwidth=6,relief=RAISED)

f1.pack()

b1=Button(f1,text="contact us",font ="arial,20,bold",padx=10,pady=10,bg="gray",command=contactus)

b1.pack(side=RIGHT,anchor="nw")

b2=Button(f1,text="about us",font ="arial,10,bold",padx=10,pady=10,bg="gray",command=aboutus)

b2.pack(side=RIGHT,anchor="nw")

b3=Button(f1,text="profile pic",font ="arial,10,bold",padx=10,pady=10,bg="gray",command=profilepic)

b3.pack(side=RIGHT,anchor="nw")

b4=Button(f1,text="name",font ="arial,10,bold",padx=10,pady=10,bg="gray",command=name)

b4.pack(side=RIGHT,anchor="nw")

obj.mainloop()


January 27, 2021

Happy birth day project


 










from tkinter import *

import time

import playsound

#BORDER STYLE(relief)= SUNKEN, RAISED, GROOVE, RIDGE

for i in range(1,10):

    root=Tk()

    root.geometry("1000x1000")

    f1=Frame(root)

    f1.pack()

    f2=Frame(root)

    f2.pack()


    lb=Label(f1,text=f'''It's 28th jan \nshivraj birthday!!!\nHAPPY BIRTHDAY TO YOU SHIVRAJ''',bg="gray",

             fg="black",padx="40",pady="20",font="arial 30 bold", borderwidth=10,relief=RAISED)

    lb.pack(anchor="ne",fill="x")

    pic=PhotoImage(file="3.png")

    lb=Label(f2,image=pic,bg="purple",

             fg="black",padx="40",pady="20",font="arial 20 bold", borderwidth=10,relief=RAISED)

    lb.pack(anchor="ne",fill="x")

    root.mainloop()

    time.sleep(0.4)


January 26, 2021

Happy republic day


















from colorama import init 

from termcolor import colored 

import time 


for i in range (1,5):

print (colored('********************************* ','green'))

time.sleep(0.5)

for i in range (1,5):

print (colored('********************************* ','white'))

time.sleep(0.5)


for i in range (1,5):

print (colored('********************************* ','red'))

time.sleep(0.5)

for i in range (1,8):

print (colored('**'))

time.sleep(0.5)

print (colored ('\n\tHappy repbulic day ','yellow'))


January 25, 2021

The flag of NEPAL using python









 




for i in range (1 , 10):

print(" *" * (i))

time .sleep(0.5)

for i in range(1 , 10):

print ( " *"*(i))

time .sleep(0.5)

for i in range (1,8):

print (" *")

time .sleep(0.5)

print ("\n\n\tThe NEPAL")

Snake Water Gun game using python

 



import random


def game(computer , your ):

if computer==your:

return None

elif computer=="s":

if your == "w":

return False

elif your=="g":

return True

elif computer =="w":

if your=="g":

return False

elif your== "s":

return True

elif computer == "g":

if your=="w":

return True 

elif your== "s":

return False

print ("\t\tSNAKE WATER GUN GAME \n")

print("computer turn ....... \nsnake(s) water (w) or gun (g)\n\t\nprocessing.......\n")

rando=random.randint(1,3)

if rando==1:

computer="s"

elif rando==2:

computer="w"

elif rando==3:

computer="g"


your = input ("your turn ::\n snake (s) water (w) or gun (g)  :  ")

a=game(computer,your)


print (f"\ncomputer choose {computer}")


if a== None :

print ('game is tie')

elif a:

print ('you win !!!')

else:

print("you lose !!!")


find the cube of the range given digits. || codeAj

Find the cube of the range given Digits. Source Code r= int ( input ( "enter the range of digit : " )) def number_conter (n): ...