Skip to main content

Posts

Showing posts from August, 2020

Code #11 Speak Function

                GREETINGS TO ALL YOU!!!! This is text to speak converter Function from  win32com.client  import  Dispatch def   speak (str):     speak = Dispatch( "SAPI.spVoice" )     speak.Speak( str ) if  __name__  ==   "__main__" :     speak("# your text goes here")

Code #8 Error Handling Program

 GREETINGS TO ALL OF YOU!!!!!! #WE ARE GOING TO HAVE A LOOK TO ERROR HANDLING TOPIC  #IN PYTHON THERE ARE 4 MAIN ERROR HANDING KEYWORD try: is a keyword were we write our logic of the program except: is a keyword which helps us to catch the error and it only runs when there is an error in the program else: is conditional keyword  finally: is a keyword which is not so important but for making our program more efficient # so let's start with our program, we will make a average finding tool # this program will take to  total marks of the user and take total number of subject: n= input ( "Enter your Name: " ) total_marks= int ( input ( "enter the total marks: " )) total_subject= int ( input ( "enter the total subject: " )) try : print (total_marks/total_subject) except ZeroDivisionError : print ( "there should be atleast 1 subject" ) else : print ( "succesfully done:" ) finally : print ( f"thank you { n } for takin...

star pattern in triangle formation

GREETINGS TO ALL OF YOU!!!!! We will continue with our PATTERN PRINTING PROGRAM # To Make Right Triangle Formation  Pattern   n= int ( input ( "enter number:... \n " )) for i in range ( 0 ,n+ 1 ): # i= 0 to 5,i=0,1,2,3,4 for j in range ( 1 ,i): #j=1,0 ,1,1 1,2 (1,3) (1,4) print ( "*" , end = '' ) print ( " " ) thank you guys !!! instagram id: https://www.instagram.com/vaibhavsingh_star/

STAR pattern printing #1

 GREETINGS TO ALL OF YOU!!!!!! WE WILL BE DOING  OUR FIRST PATTERN PRINTING PROGRAM SO LET'S START WITH IT !! WE PRINT OUR PATTER IN THIS WAY * * * * * * * * * * * *  * * * * * * * * * * * *  n= int ( input ( "enter the number:..." )) for i in range ( 1 ,n+ 1 ): for j in range ( 1 ,n+ 1 ): print ( "*" , end = " " ) print ( " " ) ACCORDING TO YOUR INPUT THE NUMBER OF ROWS AND COLUMN

code#7 Fibbuonacci series

  GREETINGS TO ALL OF YOU!!!!!!! We will be looking to the most tricky problem that is Fibbuonacci series  n= int ( input ( "enter the number till you need Fibbuonacci series: " )) first_number,second_number= 0 , 1 print (first_number,second_number, end = " " ) for i in range ( 1 ,n- 1 ): print (first_number+second_number, end = " " ) first_number,second_number=second_number,(first_number + second_number) thank you!!!

Code#6 finding square by python

GREETINGS TO ALL OF YOU!!!!!!! WE WILL MAKE A PROGRAM TO IDENTIFY THAT THE GIVEN INPUT IS A PERFECT SQUARE OR NOT A PERFECT SQUARE...  WE WILL BE USING MATH MODULE  WE HAVE TO IMPORT MATH MODULE  SO LETS START WITH IT!!!!!!! import math print ( "welcome to square root finding tool" ) i= int ( input ( "enter your number " )) a=math.sqrt(i) # it will find the square of i that is the number given by the user #when we find square root in python it gives the result in decimal(.) if (a-math.floor(a)== 0 ): print ( "it is a perfect square:" ,i) else : print ( "it is not a perfect square: " ,i) THANK YOU !!!!!!!

Code#5 PRIME NUMBER PROGRAM

          GREETINGS TO ALL OF YOU!!!!!!!!!!!!! # WELCOME EVERY ONE WE ARE HERE TO HAVE A PROGRAM ON PRIME NUMBER   # WE WILL HAVE TWO PROGRAM  # 1. TO IDENTIFY THAT THE GIVEN NUMBER IS A PRIME NUMBER OR NOT   # 2. TO PRINT ALL THE PRIME NUMBER FROM 1 TO N # 1) Pyhton program for indentifying which is a PRIME NUMBER   n= int ( input ( "pls enter your number:..... \n " )) flage = 0 for i in range ( 2 ,n): if n % i == 0 : flage = 1 if flage == 0 : print ( "it is a prime number" ) else : print ( "it is not a prime number" ) #2) Python program for printing all prime number from 1 to N n= int ( input ( "Enter the starting number:....." )) q= int ( input ( "enter the ending number:..." )) for i in range (n,q+ 1 ): flage = 0 for j in range ( 2 ,i): if i % j== 0 : flage= 1 if flage== 0 : print ( "it is a prime number: " ,i) thanks guys for joining me

Code#3 Factorial problem, Recursion and Iterative Method PROGRAM

GREETINGS TO ALL OF YOU!!  Factorial problem, Recursion and Iterative Method   #  Recursion Method  def fac2 (n): if n== 1 : return 1 else : return n*fac2(n- 1 ) number = int ( input ( "enter your number" )) print ( 'factorial of your given number by recursion method :' ,fac2(number)) # Iterative Method  def fac1 (n): fac= 1 for i in range (n): fac=fac*(i+ 1 ) return fac number= int ( input ( "enter your number: " )) print ( "factorial of your given number by iterative method:" ,fac1(number))

Code#1 ( For Making A Calculator) PROGRAM

  print ( "opration you can perform are:-") "|addition +" "|subtraction -" "|multiplication *" "|division/" "|exponent **" ) while True : num1= float ( input ( "enter your number: " )) opration=( input ( "enter your oprator: " )) num2= float ( input ( "enter 2nd number: " )) if (opration== '+' ): print (num1+num2) elif (opration== '-' ): print (num1-num2) elif (opration== '*' ): print (num1*num2) elif (opration== '/' ): print (num1/num2) elif (opration== '**' ): print (num1**num2) a= input ( "do you want to continue, if yes write yes and if no write no:......" ) if a== 'yes' : continue elif a== 'no' : break print ( "thank you !!!!!!" )