Question: DATA PROGRAMMING: PYTHON Be sure to use sys.argv NOT input. Write a program and create a function called inch2cm that takes one number in inches

DATA PROGRAMMING: PYTHON

Be sure to use sys.argv NOT input.

Write a program and create a function called inch2cm that takes one number in inches as a parameter, converts it to the centimeters and prints the result. The program output is shown below.

Input: 14

Output:

14 inches = 35.56 centimeter

Write a program and create the following functions: shapes(): takes the shape name and a number as parameters, and calls the proper function to calculate the area. areaCircle(): take one number as a parameter, calculates the area of the circle, and print the result. Round the output to 2 decimal places. areaSquare(): takes one number as a parameter, calculates the area of the circle, and prints the result. Round the output to 2 decimal places. You can assume the shape names will be circle or square (nothing else). The program output is shown below.

Input:

10

5

Output:

a) The circle area is 314.16

b) The square are is 25

Write a program and create a function called isOdd that takes a number and determine it is an odd number or not. The program output is shown below.

Input:

9

10

Output:

a) 9 is an odd number

b) 10 is not an odd number

Write a program and create a function called calc. The function generates a random integer number between 10 and 100, and determines it is divisible y 6 or not, and prints the result. The output is shown below.

Output:

a) 55 is not divisible by 6

b) 72 is divisble by 6

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 Databases Questions!