Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ai(machine learning ) Please solve by expert and make quick as soon as possible The list below recorded temperature forecast (in Celsius) of five states

image text in transcribed

Ai(machine learning )

Please solve by expert and make quick as soon as possible

The list below recorded temperature forecast (in Celsius) of five states in Malaysia for 20 Dec 2021. Perform the following operation by using Python code. STATE PERLIS KEDAH KELANTAN WP KUALA LUMPUR NEGERI SEMBILAN MAX (CELSIUS) 32 32 29 33 32 MIN (CELSIUS) 25 24 23 24 23 (a) Construct a list, min that contains the minimum temperature of the five states. Print the list and the expected output is as follows. ['PERLIS', 25, 'KEDAH', 24, KELANTAN', 23,'WP KUALA LUMPUR, 24, 'NEGERI SEMBILAN', 23] ( 2 Marks) (c) Apply subsetting and print out the last element of min. ( 2 Mark) (d) Using a combination of list subsetting and variable assignment, assign a new variable, avg_klns, that contains the average of the minimum temperature of Kuala Lumpur and Negeri Sembilan. ( 4 Marks) (e) Assign a list, twothree, that contains the second and third elements of min by using slicing. ( 2 Marks) (f) The predicted maximum temperature of Pahang on 20th Dec 2021 is 33C and the minimum temperature is 24C. Modify the code to add this record to the min list and print the output. ( 4 Marks) (g) Construct a Numpy array to store the minimum temperature of all states on 20th Dec 2021 as given in Figure 1 in Fahrenheit. The calculation to change from Celsius to Fahrenheit is given the following formula in Equation 1. Then, print the output. ( 6 Marks) C= (F-32) 1.8 (Equation 1)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions