Explore what CodeHS has to offer for districts, schools, and teachers.
Click on one of our programs below to get started coding in the sandbox!
View All
Which of the following programs prints each of the first 5 letters of the word “alphabet” on separate lines?
word = "alphabet" for letter in range (len(word) - 3): print(letter)
word = "alphabet" for i in range (len(word)): print(word[i])
word = "alphabet" for i in range (len(word) - 3): print(word[i])
word = "alphabet" for i in range (len(word) - 4): print(word[i])