1. 学习
  2. /
  3. 课程
  4. /
  5. Intermediate Python

Connected

练习

Loop over list of lists

Remember the house variable from the Intro to Python course? Have a look at its definition in the script. It's basically a list of lists, where each sublist contains the name and area of a room in your house.

It's up to you to build a for loop from scratch this time!

说明

100 XP

Write a for loop that goes through each sublist of house and prints out the x is y sqm, where x is the name of the room and y is the area of the room.