Posts

CALCULATOR

from tkinter import * def btnClick (numbers): global operator operator=operator + str (numbers) text_input.set(numbers) def btnClearDisplay (): global operator operator= "" text_input.set( "" ) def btnEqualsInput (): global operator sumup= str ( eval (operator)) text_input.set(sumup) operator= "" cal = Tk() cal.title( "calculater" ) operator= "" text_input=StringVar() textDisplay = Entry(cal , font =( "arial" , 20 , "bold" ) , textvariable =text_input , bd = 30 , insertwidth = 4 , bg = "powder blue" , justify = "right" ).grid( columnspan = 4 ) btn7=Button(cal , padx = 16 , pady = 16 , bd = 8 , fg = "black" , font =( "arial" , 20 , "bold" ) , text = "7" , command = lambda :btnClick( 7 )).grid( row = 1 , column = 0 ) btn8=Button(cal , padx = 16 , pady = 16 , bd = 8 , fg = "black"...

PYTHON 5

INPUT: import math print (math.add( 3 , 3 )) x OUTPUT: 6

PYTHON 4

input: print ( "pawandeep singh chana" ) a= 5 n= 0 while n <= 10 : print (a , 'x' , n , '=' , n*a) n+= 1 output: pawandeep singh chana 5 x 0 = 0 5 x 1 = 5 5 x 2 = 10 5 x 3 = 15 5 x 4 = 20 5 x 5 = 25 5 x 6 = 30 5 x 7 = 35 5 x 8 = 40 5 x 9 = 45 5 x 10 = 50

PYTHON 3

name= input ( 'waht is your name? \n ' ) print ( 'hi,%s.' % name)

PYTHON 2

from tkinter import * pawan_root= Tk() pawan_root.title( "singh is king" ) pawan_root.mainloop()