Question
What is the output of the following code?
count = 0
hobby = "marbles"
for letter in hobby:
count = count + 1
print(str(count))
Select one:
a.
5
b.
6
c.
7
d.
0
count = 0
hobby = "marbles"
for letter in hobby:
count = count + 1
print(str(count))
Select one:
a.
5
b.
6
c.
7
d.
0
Answers
Answer
What is the output of the following code?
hobby = "marbles"
for letter in hobby:
print("#" + letter,end="")
Select one:
a.
#######
b.
marbles
c.
Syntax error; you cannot iterate over the letters in a string using a "for" loop
d.
#m#a#r#b#l#e#s
hobby = "marbles"
for letter in hobby:
print("#" + letter,end="")
Select one:
a.
#######
b.
marbles
c.
Syntax error; you cannot iterate over the letters in a string using a "for" loop
d.
#m#a#r#b#l#e#s
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.