0
x=["F",66,"QE",15,"S",34] Y=0 ,Z="",A=0 for c in range (1,6,2): Y+=c Z=Z+X[c-1]+'#x27;A+=X[c] print(X,Y,Z)
Please correct the code
4 Antworten
+ 2
# Do you mean correct the incorrect spacing, commas, and variables?
X=["F",66,"QE",15,"S",34]
Y=0
Z=""
A=0
for c in range (1,6,2):
Y+=c
Z=Z+X[c-1]+'#x27;
A+=X[c]
print(X,Y,Z)
output:
['F', 66, 'QE', 15, 'S', 34] 9 F$QE$S$
+ 1
x and X are not the same variables, try to write a clean code, don't mash everything together.
eg Z=Z+X[c-1]+'#x27;A+=X[c] does not make any sense
0
Thanks for correcting my mistake