A number, a, is a power of b if it is divisible by b and a/b is a power of b. Write a function called is_power that takes parameters a and b and returns True if a is a power of b. Note: you will have to think about the base case. After writing your is_power function, include the following test cases in your script to exercise the function and print the results:
print("is_power(10, 2) returns: ", is_power(10, 2))
print("is_power(27, 3) returns: ", is_power(27, 3))
print("is_power(1, 1) returns: ", is_power(1, 1))
print("is_power(10, 1) returns: ", is_power(10, 1))
print("is_power(3, 3) returns: ", is_power(3, 3))
You should submit a script file and a plain text output file (.txt) that contains the test output. Multiple file uploads are permitted. Don’t forget to include descriptive comments in your Python code.
School Management System using file handling
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:
Consider the following preemptive variant of the Load Balancing problem: There are m identical machines, and n jobs with processing times t1, t2,...., tn respectively. Each machine can process at most one job at a time. Each job can run on more than one machines but must run on at most one machine at any time. Let T = max { max (1<=j<=n) tj , 1/ m "summation" (1<=j<=n) tj }
You need to write a program to manage the Inventory of the used cars.
Task 1: Create a simple text-based “Console Application” in C# to maintain a catalog of used cars. The catalog keeps track of each car's make, model, year, and sale price. The program begins with an empty catalog. The program can perform the following operations:
• Adding a new car
• Modify the details of a particular car
• Search for a particular car in the Catalog
• List all the cars in the Catalog
• Delete a car from the Catalog
• Quit
If an unknown command is entered, the user should be informed and asked to enter another command. Hint:
1) Create a class called as Car. Create appropriate constructors (Default and Parameterized), Properties for the Car class.
2) Use Array to store the Objects of a car.
Once the code is ready, get a peer review done. Maintain the list of issues / bugs identified during the review. You are supposed to fix those issues.
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.