Question: 1 . Create a Python program that includes a function to calculate the sum of two numbers provided by the user. The program should follow

1. Create a Python program that includes a function to calculate the sum of two numbers provided by the user. The program should follow these steps: Define a function called addition that takes two parameters (number1 and number2) and returns the sum of these two numbers. Prompt the user to enter the first number. Prompt the user to enter the second number. Call the addition function with the numbers entered by the user. Print the result, which is the sum of the two numbers.
2. Create a Python program that includes a function to find the maximum of two numbers entered by the user. The program should follow these steps: Define a function called find_maximum that takes two parameters (num1 and num2) representing the two numbers to compare. This function should return the maximum of the two numbers. Prompt the user to enter the first number. Prompt the user to enter the second number. Call the find_maximum function with the two numbers entered by the user. Print the result, which is the maximum of the two numbers entered by the user.
3. Write a Python function that takes a character as input and draws a hollow rectangle shape on the screen based on the dimensions provided by the user. The function should follow these steps: Define a function called draw_hollow_rectangle that takes three parameters: the character to be used for drawing the rectangle, the width of the rectangle, and the height of the rectangle. Use nested loops to iterate through each row and column of the rectangle. Check if the current position is on the border of the rectangle (i.e., the first row, last row, firstcolumn, or last column). If so, print the specified character; otherwise, print a space. Print a newline character at the end of each row to move to the next row. In the main program, prompt the user to enter the character they want to use for the rectangle,as well as the width and height of the rectangle. Call the draw_hollow_rectangle function with the user's inputs to draw the hollow rectangleon the screen.
4. Write a Python program that takes a number as input from the user and returns its absolute value. The program should perform the following steps: Prompt the user to enter a number. Read the number from the user. Calculate the absolute value of the entered number. Print the absolute value of the entered number. 5. In a particular jurisdiction, taxi fares consist of a base fare of $4.00, plus $0.25 for every 140 meters traveled. Write a function that takes the distance traveled (in kilometers) as its only parameter and returns the total fare as its only result. Write a main program that demonstrates the function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!