Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SE PYTHON PLEASE!!! Only need question 4 answered! # 2) Creating Lists (lists.py) # # 2.1 Given the information below, build a list named 'house',

SE PYTHON PLEASE!!! Only need question 4 answered! # 2) Creating Lists (lists.py) # # 2.1 Given the information below, build a list named 'house', such that: # Item 1 = Name of first room ("Hallway") # Item 2 = Area of first room (11.25) # Item 3 = Name of second room ("Kitchen") # ... # Item 9 = Name of fifth room # Item 10 = Area of fifth room hall = 11.25 # Hallway kit = 18.0 # Kitchen liv = 20.0 # Living Room bed = 10.75 # Bedroom bath = 9.50 # Bathroom house = # Build the list here. # 2.2) Write code to print out the list 'house' # # 2.3) Write code to print out the second item (Area of Hallway) from the 'house' list # # 2.4) Write code to print out the last item (Area of Bathroom) from the 'house' list, using a negative index # # 2.5) Write code to print out the area of the living room # # 2.6) Write code to create a variable called 'eat_sleep_area' that is set to the sum of the areas of the bathroom # and kitchen. Then, print the variable 'eat_sleep_area' # 3. Slicing/Striding (slices.py) # # 3.1) Recreate the 'house' list from above. Use slicing to create two new lists: # a. 'downstairs', which contains the first 3 rooms and their areas # b. 'upstairs', which contains the last 2 rooms and their areas # # Print 'upstairs' and 'downstairs' # 3.2) Use Striding with the 'house' list to create two new lists: # a. 'rooms', which contains only the names of the rooms # b. 'areas', which contains only the areas of the rooms # # Print 'rooms' and 'areas' # 4. Modifying Lists (listmod.py) # # 4.1) Recreate the 'house' list from above. Write code that will update the area of the bathroom to be 10.50 # instead of 9.50, then print 'house' # # 4.2) Change the name of "Living Room" to "Chill Zone", then print 'house' # # 4.3) Create a new list named 'house_1' that includes a new room, "Pool House", with an area of 24.5. Then, # print house_1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Real Time Database And Information Systems Research Advances

Authors: Azer Bestavros ,Victor Fay-Wolfe

1st Edition

1461377803, 978-1461377801

More Books

Students also viewed these Databases questions