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

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
Answered by GPT 3.5
c. 7
Answered by GPT 3.5
d. #m#a#r#b#l#e#s

Related Questions