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
3 answers
c. 7
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
d. #m#a#r#b#l#e#s