リストのメソッド(2)
この演習はコースの一部です
Python 入門
演習の手順
.append()を2回使って、プールハウスとガレージの面積(24.5と15.45)をこの順番で追加してください。areasを出力してください。.reverse()メソッドを使って、areasの要素の順番を逆にしてください。- もう一度
areasを出力してください。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Create list areas
areas = [11.25, 18.0, 20.0, 10.75, 9.50]
# Use append twice to add poolhouse and garage size
# Print out areas
# Reverse the orders of the elements in areas
# Print out areas