<repo_name>sapmanoj/manoj<file_sep>/newtone.py
def proterm(i, value, x):  
    pro = 1;  
    for j in range(i):  
        pro = pro * (value - x[j]);  
    return pro;  
  
# Function for calculating  
# divided difference table  
def dividedDiffTable(x, y, n): 
  
    for i in range(1, n):  
        for j in range(n - i):  
            y[j][i] = ((y[j][i - 1] - y[j + 1][i - 1]) /
                                     (x[j] - x[i + j])); 
    return y; 
  
# Function for applying Newton's  
# divided difference formula  
def applyFormula(value, x, y, n):  
  
    sum = y[0][0];  
  
    for i in range(1, n): 
        sum = sum + (proterm(i, value, x) * y[0][i]);  
      
    return sum;  
  
# Function for displaying divided  
# difference table  
def printDiffTable(y, n):  
  
    for i in range(n):  
        for j in range(n - i):  
            print(round(y[i][j], 4), "\t",  
                               end = " ");  
  
        print("");  
  
# Driver Code 
  
# number of inputs given  
n = 5;  
y = [[0 for i in range(10)]  
        for j in range(10)];  
x = [ 11, 12, 13, 14,15 ];  
  
# y[][] is used for divided difference  
# table where y[][0] is used for input  
y[0][0] = 2435;  
y[1][0] = 2475;  
y[2][0] = 2490;  
y[3][0] = 2487; 
y[4][0] = 2506;  
 
  
# calculating divided difference table  
y=dividedDiffTable(x, y, n);  
  
# displaying divided difference table  
printDiffTable(y, n);  
  
# value to be interpolated  
value = 16;  
  
# printing the value  
print("\nValue at", value, "is", 
        round(applyFormula(value, x, y, n), 2)) 
  
# This code is contributed by mits 
<file_sep>/01.py
for i in range(0,10):
 for j in range(0,10-i):
   print(" ",end="")
 for k in range(0,2*i+1):
  print("0",end="")
 print("")<file_sep>/Emailsend.py
import smtplib

msz="hello this is message from ncitday19"
a=smtplib.SMTP('smtp.gmail.com',587)
a.ehlo()
a.starttls()
mail.login('<EMAIL>','itsme1234')
mail.sendmail('<EMAIL>','<EMAIL>',msz)
mail.close()

 <file_sep>/06.py

    
import tkinter as Tkinter
import time
BALL_SPEED=5

class GameCanvas(Tkinter.Canvas):
    def __init__(self, *args, **kwargs):
        Tkinter.Canvas.__init__(self, *args, **kwargs)
        self.create_bouncing_ball()
        self.create_moving_bat()
        
    def create_moving_bat(self):
        self.bat=Tkinter.Canvas.create_rectangle(self,0,570,100,580, fill='lightslateblue')
        self.bind('<Motion>', self.update_bat_moves)
        return
    
    def update_bat_moves(self, event=None):
        x=event.x
        x1,y1,x2,y2=self.coords(self.bat)
        gap=(x2-x1)/2
        center=x1+gap
        move=x-center
        self.move(self.bat,move,0)
        return
        
    def create_bouncing_ball(self):
        self.ball=Tkinter.Canvas.create_oval(self, 0,0,20,20, fill='cornflowerblue')
        self.x=BALL_SPEED
        self.y=BALL_SPEED
        return
    
    def update_board(self):
        width=self.winfo_width()
        height=self.winfo_height()
        x1,y1,x2,y2=self.coords(self.ball)
        hit=len(self.find_overlapping(x1,y1,x2,y2))
        if hit>=2:
            self.y=-BALL_SPEED
            self.move(self.ball,self.x,self.y)
        elif x1<0:
            self.x=BALL_SPEED
            self.move(self.ball,self.x,self.y)
        elif x2>width:
            self.x=-BALL_SPEED
            self.move(self.ball,self.x,self.y)
        elif y1<0:
            self.y=BALL_SPEED
            self.move(self.ball,self.x,self.y)
        elif y2>height:
            x=width/2
            y=height/2
            self.create_text(x,y, text='Game Over', font=('arial 50 bold'), fill='red')
            self.y=-BALL_SPEED
            self.move(self.ball,self.x,self.y)            
        else:
            self.move(self.ball,self.x,self.y)
        return
def main():
    root=Tkinter.Tk()
    root.minsize(800,600)
    root.maxsize(800,600)
    board=GameCanvas(root, bg='lavender')
    board.pack(expand='yes', fill='both')
    # Program Loop
    while True:
        root.update()
        root.update_idletasks()
        board.update_board()
        time.sleep(0.01)

# main Trigger
if __name__=='__main__':
    main()<file_sep>/num2word.py
number=[" ","one","Two","Three","four","Five","Six","Seven","eight","nine"]
nty=[" "," ","Twenty","Thirty","fourty","Fifty","Sixty","Seventy","eighty","ninty"]
tens=["ten"," eleven","twelve","thirteen","fourteen","Fifteen","Sixteen","Seventeen","eighteen","ninteen"]
n=int(input("enter a number"))
if n>99999:
 print("cant solve for more than 5 digits")
else:
 d=[0,0,0,0,0,]
 i=0
 while n>0:
  d[i]=n%10
  i+=1
  n=n//10
 num=""
 if d[4]!=0:
   if(d[4]==1):
     num+=tens[d[3]]+" thousands "
   else:
     num+=nty[d[4]]+" "+number[d[3]]+" thousands "
 else:
   if d[3]!=0:
    num+=number[d[3]]+" thousands "
 if d[2]!=0:
   num+=number[d[2]]+" Hundred "
 if d[1]!=0:
   if(d[1]==1):
     num+=tens[d[0]]
   else:
     num+=nty[d[1]]+" "+number[d[0]]
 else:
   if d[0]!=0:
    num+=number[d[0]]
 print(num)
   
  
  
<file_sep>/04.py
import turtle

wn=turtle.Screen()
wn.title("Pong")
wn.bgcolor("blue")
wn.setup(width=800,height=600)
wn.tracer(0)


#paddle A
paddle_a=turtle.Turtle()
paddle_a.speed(0)
paddle_a.shape("circle")
paddle_a.color("black")
paddle_a.shapesize(stretch_wid=5,stretch_len=1)
paddle_a.penup()
paddle_a.goto(-350,0)



#paddle B



#ball
     


#main game loop
while True:
 wn.update()