Answer:
import math
n = int(input("Enter the number of sides: "))
s = float(input("Enter the length of a side: "))
area = (n * s**2) / (4 * math.tan(math.pi/n))
print("The area is: " + str(area))
Explanation:
*The code is in Python.
Import the <u>math</u> to be able to compute the <em>pi</em> and <em>tan</em>
Ask the user to enter the number of sides and the length of a side
Calculate the area using the given formula
Print the area
Explanation:
it is false because it is not appropriate
It can pollute the whater which is the habit to many animals making it not safe fo be in the whater
Answer:
- jersey_dict = {}
-
- for i in range(5):
- j_num = int(input("Input Jersey's number (0-99): "))
- rating = int(input("Input rating (1 - 9): "))
- jersey_dict[j_num] = rating
-
- sorted_key = []
- for i in jersey_dict.keys():
- sorted_key.append(i)
-
- sorted_key.sort()
- for i in sorted_key:
- print(str(i) + ":" + str(jersey_dict[i]))
Explanation:
Firstly, define an empty dictionary (Line 1).
Next, use a for loop to prompt user to input five Jersey's number and rating and keep the input to the dictionary (Line 3-6). Next, create a list to hold the dictionary keys (Line 8-10). Use build in method, sort to arrange the keys in the list in ascending order (Line 12 ). At last, print the dictionary element by looping over the value in the sorted_key list (Line 14-15).