0
Please help mešš
I wanna to print a word or a number but not all the letters or digits for example i wanna print "0921677821" but without "0" Or print "abcdefgh" but from "b" to "f" What should i do?
8 Answers
+ 9
You should familiarize yourself with slicing:
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2453
(works similar for strings)
+ 3
Thank you for your helpšš¹
+ 3
You can do it by slicing
+ 1
Thank you allš¤©š
+ 1
for i in "0921677821":
if int(i)!=0:
print(i)
for i in "abcdefgh":
if i>="b" and i<="f":
print(i)
+ 1
Use slicing of strings. It goes like this...str[a:b]
This string will start from a and go till (b-1). Note that b isn't included in the string
0
Can you explain it?