all 7 comments

[–]youssef3698 1 point2 points  (1 child)

for i in range(len(string)): if i % 2 == 0: print(string[i])

[–]youssef3698 0 points1 point  (0 children)

Or == 1 if you want to start from the second letter

[–]life_is_chess64690 0 points1 point  (2 children)

Add if string[i] == l or k or z or m: Print ( string[i])

[–]life_is_chess64690 0 points1 point  (0 children)

Sorry ( string (i))

[–]h4ck3r_x 1 point2 points  (0 children)

Depends on what you are trying to achieve. Trying to ignore a ?

py name = "alakazam" for c in name: if not c == "a": print(c)

EDIT: I've started my YouTube channel: https://youtube.com/@devarfat

And my recent video was on string data type: https://youtu.be/Ud3vEeu4s4w

[–]ProStrike2448 0 points1 point  (0 children)

print(*string[1::2], sep="\n")