Posts

Showing posts from May 16, 2021

How to find median | Class 10 | Updated a program made with python.

Find median of group data . As I made a median finder made with python , it was working but finding wrong answer but now I have updated that and this updated program is working properly and giving correct answer. So here is the code. def median (l,n,cf,f,h): """This is a functions to find median of given group data you have to put only the required values """ a=n/ 2 b=a-cf c=b/f d=c*h x=d+l return x print ( "This is a calculator which calculate median" ) print ( "So first put value of l" ) l= int ( input ()) print ( "Now enter the value of n" ) n= int ( input ()) print ( "Put value of cf" ) cf= int ( input ()) print ( "Enter value of f" ) f= int ( input ()) print ( "put value of h" ) h= int ( input ()) print ( "Your median of given values is" ,median(l,n,cf,f,h))

How to write a Python program for taking input from user for implementing assignment operators on it?

How to write a Python program for taking input from user for implementing assignment operators on it? First you have to take input from user by input command and for testing assignment operator you have to typecast it into an integer and after this I just wanted to tell that Assignment operators in python assign a value in a variable , like to add a digit in a variable's value which is an int , or adding a digit using assignment operator in a variable's value which is entered by the user for doing this here is a code for and example -- x= int ( input ( "Enter your number" )) x+= 5 print ( "After adding 5 in your number-" ,x) #after this we can also do subtraction from the entered number entered by the user x-= 5. print ( "After subtracting 5 from your number-" ,x) One thing which is to be remembered is that after using "x-=5" it will change the real digit which is stored in the variable. For example if you enter 10 in the input in the cod...