Skip to main content

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 ...

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)

GAME CONDITION 

For game condition and determine winner we have to use IF ,ELSE condition .

After while loop complete we calculate the points of user and computer and print the winner and there points.



HERE ARE THE CODE OF GAME 



OUTPUT