Using Python Simplify Code Lakes Erie Huron Michigan Ontario Superior Range Len Lakes Prin Q37020098

Using python : Simplify the code.

lakes = [“Erie”, “Huron”, “Michigan”, “Ontario“, ”Superior“]

for i in range(len(lakes)) :

print(lakes[i], end=“”)

if i < len(lakes) -1:

print(“I”, end=””)


Solution


saved https://WrongHospitable Tabs.yogeshkumar.repl.run lakes [Erie, Huron, Michigan, ontario, Superior) 1 2 Python

lakes = [“Erie”, “Huron”, “Michigan”, “Ontario”, “Superior”]print(‘I’.join(lakes), end=”)

please upvote.

saved https://WrongHospitable Tabs.yogeshkumar.repl.run lakes [“Erie”, “Huron”, “Michigan”, “ontario”, “Superior”) 1 2 Python 3.6.1 (default, Dec 2015, 13:85:11) [GCC 4.8.2] on linux ErteIHuronIichiganIOntartoISupertor ErieIHuronIMichiganIOntarioISuperior 3 for i in range(len(lakes)) print (lakes[i], end-) if i len(lakes)-1: 4. 6 7 8 9 print( print(“I”, end-“”) 10 printI.join(lakes)

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.