Support our Blind Hand Charity by donating at 9818291723. Your contribution has the potential to bring about significant positive change for humanity.

Search This Blog

Thursday, May 25, 2023

POINT PLOTTER

import matplotlib.pyplot as mp
import numpy as np
print("Enter the first coordinate = ")
x1=float(input("Enter X = "))
y1=float(input("Enter Y = "))
print("Enter the second coordinate = ")
x2=float(input("Enter X = "))
y2=float(input("Enter Y = "))
print("Enter the third coordinate = ")
x3=float(input("Enter X = "))
y3=float(input("Enter Y = "))
print("Enter the fourth coordinate = ")
x4=float(input("Enter X = "))
y4=float(input("Enter Y = "))
mp.plot(x1,y1,x2,y2,'o-b')
mp.plot(x2,y2,x3,y3,'o-.r')
mp.plot(x3,y3,x4,y4,'o--c')
mp.plot(x4,y4,x1,y1,'o:y')
mp.show()

OUTPUT



Wednesday, May 24, 2023

PLOT AN ELLIPSE

import matplotlib.pyplot as mp
import numpy as np
c=int(input("Enter the latitude of ellipse = "))
d=int(input("Enter the longitude of ellipse = "))
mp.grid()
a=np.linspace(0,360,10000000)
x=c*np.cos(a)
y=d*np.sin(a)
mp.plot(x,y)
mp.show()

OUTPUT



Monday, May 22, 2023

PASCAL'S TRIANGLE

n=int(input("Enter the range = "))
x=1
s=1
h=1
m=1
y=0
for i in range(s,n+1):

    for k in range(n+1,i,-1):
        if k==i+1:
            print(1,end=" ")
        else:
            print(end=" ")
    for j in range(1,i+1):
        f1=1
        f2=1
        f3=1
        for f in range(1,i+1):
            f1=f1*f
        for f in range(1,j+1):
            f2=f2*f
        for f in range(1,(i-j)+1):
            f3=f3*f
        print(f1//(f2*f3),end=" ")
    print()

OUTPUT



Sunday, May 14, 2023

LIST NUMBER LOCATOR

l=[]
s=0
a=1
while a!=0:
    a=int(input("Enter number without repetition or 0 to exit = "))
    l.append(a)
n=int(input("Enter the number to search = "))
c=0
for i in range(0,len(l)):
    if l[i]==n:
        print("The number found =",n,"position =",i+1)
    else:
        print(end="")

OUTPUT



Saturday, May 13, 2023

SHOP DISCOUNT SYSTEM

n=input("Enter the name = ")
a=int(input("Enter the age = "))
b=int(input("Enter 1 for male and 0 for female = "))
c=int(input("Enter 1 for rural area and 0 for urban area = "))
y=0
for i in range(1,6):
    y+=int(input("Enter cost of article = "))
if c==1:
    if b==1:
        if 0<=a<=15:
            d=y*0.06
            t=y*0.01
            b=y-d+t
        elif 16<=a<=30:
            d=y*0.03
            t=y*0.01
            b=y-d+t
        elif 31<=a:
            d=y*0.04
            t=y*0.01
            b=y-d+t
    elif b==0:
        if 0<=a<=15:
            d=y*0.065
            t=y*0.01
            b=y-d+t
        elif 16<=a<=30:
            d=y*0.035
            t=y*0.01
            b=y-d+t
        elif 31<=a:
            d=y*0.045
            t=y*0.01
            b=y-d+t
elif c==0:
    if b==1:
        if 0<=a<=15:
            d=y*0.05
            t=y*0.015
            b=y-d+t
        elif 16<=a<=30:
            d=y*0.02
            t=y*0.015
            b=y-d+t
        elif 31<=a:
            d=y*0.03
            t=y*0.015
            b=y-d+t
    elif b==0:
        if 0<=a<=15:
            d=y*0.055
            t=y*0.015
            b=y-d+t
        elif 16<=a<=30:
            d=y*0.025
            t=y*0.015
            b=y-d+t
        elif 31<=a:
            d=y*0.035
            t=y*0.015
            b=y-d+t
print("Total =",b,"\t","Discount =",d,"\n","Tax =",t)

OUTPUT

Thursday, May 11, 2023

NATURE OF NUMBER

n=1
y=0
x=0
while n!=0:
    n=int(input("Enter the number and 0 to exit = "))
    if n==0:
        break
    elif n==abs(n):
        x+=1
    elif n!=abs(n):
        y+=1
print("\n","Number of positive numbers =",x,"\n","Number of zero digits =",1,"\n","Number of negative numbers =",y)

OUTPUT



Sunday, May 7, 2023

MAXIMUM AND MINIMUM FINDER

n=1
maxx=-9999
minn=9999
while n!=0:
    n=int(input("Enter n and 0 to exit :  "))
    if n==0:
        break
    if maxx<n:
        maxx=n    
    if minn>n:
        minn=n
print("The max   = ",maxx," min   = ",minn)


OUTPUT