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

29th Aug 2020, 2:25 PM
Yogesh Agarwal
Yogesh Agarwal - avatar
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$
29th Aug 2020, 2:39 PM
Steven M
Steven M - avatar
+ 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
29th Aug 2020, 2:37 PM
Martin Maphaha
Martin Maphaha - avatar
0
Thanks for correcting my mistake
29th Aug 2020, 2:43 PM
Yogesh Agarwal
Yogesh Agarwal - avatar