Skip to main content

Posts

How to make calculator in python kivy

  How make calculator in python We make a calculator in python using kivy module . Kivy module helps us to make android apps . First wait , If you run a kivy program in your terminal then you see a error like this To solve this problem you have to go kivy docs and follow the instruction of kivy docs.  First we have to make a virtual environment and then in the virtual environment you have to install kivy . After that you have to write  kivy_venv\Scripts\activate in your terminal and then run the file . If this method not work then write the comment below. LETS START CODING First we import kivy .For this we hve to write  from  kivy.app  import  App from  kivy.uix.label  import  Label from  kivy.uix.button  import  Button from  kivy.core.window  import  Window from  kivy.uix.gridlayout  import  GridLayout from  kivy.uix.widget  import  Widget from  kivy.lang  import ...

How to make Desktop Voice Assistant in python

  What is Desktop Voice Assistant Desktop voice assistant  is a computer program which listen commands and complete task assigned by the user. It is a example of weak AI which only execute and perform task designed by the programmer. How to make desktop Voice Assistant We have to write a program in python for desktop voice assistant. Modules Required pyttsx3 - pyttsx3 is a text to speech conversion module in python. pyttsx3 helps us to convert text into speech . We have to import pyttsx3. we write  import  pyttsx3 to import pyttsx3. For changing the gender of voice we have to write  engine= pyttsx3.init() voices=engine.getProperty( "voices" ) engine.setProperty( "voice" , voices[ 1 ].id) Note- If pyttsx3 is not install for some reason , first you have to check the pip list for this we have to write pip list.  After that   you should go to https://pypi.org/project/pyttsx3   and click the release version and select the version w...

HOW TO MAKE GUESS A NUMBER GAME IN JAVA

  Guess A Number Game In Java Guess a number game is a game in which a random number is generated by the computer and we have to guess the number.  we write a computer program with the help of java .  Lets start coding Import java.util.Random First import random module to generate random number by the computer .we have to write  import   java . util . Random ; After import random we have to generate random number .For this we have to write  Random   r = new   Random ();       int   computerguess = r . nextInt ( 100 ); Taking user input  For taking user input we have to import  java . util . Scanner .So, we have to write import   java . util . Scanner ; For taking user input we have to write  System . out . println ( "Enter your guess number:" );              Scanner   sc = new   Scanner ( System . in );  ...

HOW TO MAKE SIMPLE CALCULATOR IN JAVA

  HOW TO MAKE SIMPLE CALCULATOR IN JAVA We write a program in java language to make a calculator . First , we have to take input from the user: For taking input from user we have to import java.util.Scanner . So ,we write  import   java . util . Scanner ; Taking input from the user we have to take three input from user  1. First number  2. Mathematical operation user want to do 3. Second number  NOTE- mathematical operation only take ADDITION(+),SUBTRACTION(-), MULTIPLICATION(*) AND DIVISION(/) For taking input we have to write : Scanner   sc = new   Scanner ( System . in );          System . out . println ( "Enter the 1st number:" );          Double   no1 = sc . nextDouble ();          System . out . println ( "Enter the operation:" );          ...

HOW TO MAKE GUESS A NUMBER GAME IN PYTHON

  Guess A Number Game In Python Guess a number game is a game in which a random number is generated by the computer and we have to guess the number.  we write a computer program with the help of python .  Lets start coding Import random First import random module to generate random number by the computer .we have to write  import  random. After import random we have to generate random number .For this we have to write  computerguess=random.randint( 1 , 100 ). Taking user input  For taking user input we have to write  userguess= int ( input ( "Enter your guess number: \n " )) NOTE- taking user input in while loop. Game condition  for the game condition we have to use if ,else condition . when user input is equal to number generated by the computer then display  Your guess is right  You guess number in  i  Times . here i is number of times user take to guess number generated by co...

HOW TO MAKE SIMPLE CALCULATOR IN PYTHON

HOW TO MAKE   SIMPLE CALCULATOR IN PYTHON  To make a simple calculator we write a program in python language .  Taking input from the user we have to take three input from user  1. First number  2. Mathematical operation user want to do 3. Second number  NOTE- mathematical operation only take ADDITION(+),SUBTRACTION(-), MULTIPLICATION(*) AND DIVISION(/) For taking these input we have to write : number1= int ( input ( "Enter the 1st number: \n " ))  operation= input ( "Enter the operation: \n " ) number2= int ( input ( "Enter the 2nd number: \n " )) Calculating the numbers For calculating the numbers we have to use if else condition . When operation input is equal to (+) then input numbers will be add. When operation input is equal to (-) then input numbers will be subtract. When operation input is equal to (*) then input numbers will be multiply. When operation input is equal to (/) then input numbers will b...

ROCK PAPER SCISSOR GAME IN PYTHON

  What is Rock Paper Scissor game? Rock paper scissor game is hand game played between two players ,in each player at the same time forms one of three shapes. Rock Paper Scissor game in python  When we want to rock paper scissor game with computer what we do for this  we make a computer program with the help of python .   LETS START CODING We use while loop to play  game five times after that calculate the points of both user and computer then print the winner and there points. In this game we take  1 for stone,  2 for paper,  3 for scissor. Import random We have to   import random module to generate the computer choice. simply ,we have to write import random  to import random module. Taking user input  For taking user input we have to write  int ( input ( "Enter your play:" )) MAKING  COMPUTER CHOICE  For computer choice we have to write  random.randint( 1 , 3 ) ...