As an exercise, use incremental development to write a function called hypotenuse that returns the length of the hypotenuse of a right triangle given the lengths of the other two legs as arguments. Record each stage of the development process as you go.
After the final stage of development, print the output of hypotenuse(3, 4) and two other calls to hypotenuse with different arguments.
Include all of the following in your Learning Journal:
given a number of mangoes and number of persons. Find the number of ways to distribute identical mangoes among identical persons in python
Using Python create a module that contains area calculation functions of different shapes (triangle, circle and rectangle). You need to utilize this module in your main program that prompts user to enter the shape type and depending on user input it should return the accurate area calculation results.
Next, you need to create functions within your main program that calculate and display the volume and surface area of a cylinder.
Note: Avoid duplication to gain maximum marks. Make use of functions written inside module where ever possible to ensure reusability and modularity.
Write a function that accepts an integer value and returns the binary, octal and hexadecimal equivalent representation to the console.
Write a function distance that calculates the distance between two points (x1, y1) and (x2, y2). All numbers and return values should be of floating type. Use this function in your program. The values of the points shall be provided by the end user.
Write an interactive Python calculator program. The program should allow the user to type in a mathematical expression, and then it should evaluate and print the resultant value of the expression. Include a loop so that the user can perform many calculations one after the other.
To quit early, the user can make the program crash by typing a bad expression (e.g., (2 + 2) * 5 ! 4) (You’ll learn better ways of terminating interactive programs in later lessons) or a user can terminate it simply by entering Quit as sentinel value.
Write a temperature converter program that uses lambda functions to convert from Fahrenheit to Celsius and vice versa.
Write a temperature converter program that uses lambda functions to convert from Fahrenheit to Celsius and vice versa.
Write a function distance that calculates the distance between two points (x1, y1) and (x2, y2). All numbers and return values should be of floating type. Use this function in your program. The values of the points shall be provided by the end user.
Write an interactive Python calculator program. The program should allow the user to type in a mathematical expression, and then it should evaluate and print the resultant value of the expression. Include a loop so that the user can perform many calculations one after the other.
To quit early, the user can make the program crash by typing a bad expression (e.g., (2 + 2) * 5 ! 4) (You’ll learn better ways of terminating interactive programs in later lessons) or a user can terminate it simply by entering Quit as sentinel value