Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

A MAILAM GNU LINUX USER GROUP INTIATIVE- USE THIS AND SHARE THIS #Program to print squareroot and

cube root of first 100 numbers #PYTHON version used : 3.2.2 PROGRAM NO:1 print(" TO PRINT THE SQUARE AND CUBES FROM 1 TO 1000 \n ") ik=input("enter the number you want to know the square and cube \n") ik=int(ik) #for i in range(10): print(" GIVEN NO IS [",ik," + ",len(str(ik)),"] THE SQUARE IS(",ik*ik," + ",len(str(ik*ik)),")THE CUBE IS {",ik*ik*ik,"}\n") #Program to open a webpage in a browser #PYTHON version used : 3.2.2 PROGRAM NO:2 import webbrowser webbrowser.open("www.google.com") #Program to convert given kelvin to celsius USING PYTHON #PYTHON version used : 3.2.2 PROGRAM NO:3 #formula is tc=tk-273.15 , tc =temprature in celcius , tf=temprature in farenheit tk=float(input(enter kelvin temperature)) tc=tk-273.15 tc=round(tc,2) print("GIVEN TEMPRATURE IN KELVIN IS : ",tk,"\n") print("GIVEN TEMPRATURE IN celsius IS : ",tc,"\n") #Program to convert given celsius to kelvin USING PYTHON #PYTHON version used : 3.2.2 PROGRAM NO:4 #formula is tk=tc+273.15 , tc=temprature in celcius , tf=temprature in farenheit tc=float(input(enter celsius temprature)) tk=tc+273.15 print("GIVEN TEMPRATURE IN celsius IS : ",tc,"\n") print("GIVEN TEMPRATURE IN KELVIN IS : ",tk,"\n") #Program to convert given celsius to fahrenheit USING PYTHON #PYTHON version used : 3.2.2 PROGRAM NO:5 #formula is tf=((tc*9)/5)+32 , tc=temprature in celcius , tf=temprature in farenheit tc=float(input(enter celsius temprature)) tf=(tc*9)/5 tf=tf+32 tf=round(tf,2) print("GIVEN TEMPRATURE IN celsius IS : ",tc,"\n") print("GIVEN TEMPRATURE IN FARENHEIT IS : ",tf,"\n")

For more programs visit : www.datatycoon.blogspot.com

A MAILAM GNU LINUX USER GROUP INTIATIVE- USE THIS AND SHARE THIS #Program to convert given fahrenheit to celsius USING PYTHON #PYTHON version used : 3.2.2 PROGRAM NO:6 #formula is tc=(5/9)*tf-32, tc=temprature in celcius , tf=temprature in farenheit tf=float(input(enter farenheit temprature)) tc=(5/9)*tf-32 tc=round(tc,2) print("GIVEN TEMPRATURE IN FARENHEIT IS : ",tf,"\n") print("GIVEN TEMPRATURE IN celsius IS : ",tc,"\n") #Program to find THE GIVEN NUMBER IS ARMSTRONG OR NOT USING PYTHON #PYTHON version used : 3.2.2 PROGRAM NO:6 import math a=input(ENTER A NUMBER) b=len(a) t1=int(a) t2=list(a) sum=0 for i in range(b): sum=sum+(math.pow(int(t2[i]),3)) print(t2[i]," +-+ ",int(sum)) if t1==sum : print(t1," is an armstrong number") else: print(t1," is NOT an armstrong number") #Program ADD TWO STRINGS PYTHON #PYTHON version used : 3.2.2 PROGRAM NO:7 #current program filename is q1.py called in next program print( "\n" * 70) a="indian" b="culture" for i in range(2): print(a+b) a= "" b= "" for i in range(2): print(a+b)

For more programs visit : www.datatycoon.blogspot.com

A MAILAM GNU LINUX USER GROUP INTIATIVE- USE THIS AND SHARE THIS #Program to find odd or even using PYTHON #PYTHON version used : 3.2.2 PROGRAM NO:8 #imnport q1 means calling previous program shows simple inheritance import q1 print("Enter a Number") inp=int(input()) if inp%2==0 : print(inp,"\t Number is EVEN \n") else: print(inp,"\t Number is ODD \n") print ("output of program q1.py called in program q1.py: \n" ,q1.a,"-",q1.b,"-",q1.a+q1.b) #Program to get the students name and marks of five subjects and print the average #PYTHON version :3.2.2 PROGRAM NO:9 s1=input("enter subject name ") m1=input("enter marks for 100 for 1 subject") s2=input("enter subject name ") m2=input("enter marks for 100 for 2 subject") s3=input("enter subject name ") m3=input("enter marks for 100 for 3 subject") m4=int(m1)+int(m2)+int(m3) print(s1," = ",m1,"\n",s2," = ",m2,"\n",s3," = ",m3,"\n"); print("TOTAL :",m4,"\n") print("AVEGARE :",round(m4/3,2),"\n") #Program to display the multiplication table of a given no #PYTHON version :3.2.2 PROGRAM NO:10 val=input("ENTER NUMBER FOR WHICH MULTIPLICATION TABLE YOU NEED \n") for i in range(25): i=i+1 print( i," X ",int(val)," = ",int(i)*int(val),"\n") #Program for simple interest #PYTHON version :3.2.2 PROGRAM NO:11 p=input(" \n") n=input(" \n") r=input(" \n") print(" :-\n",float(p)*float(n)*float(r)/100)

For more programs visit : www.datatycoon.blogspot.com

You might also like