String Slicing Flashcards
text = “Python Programing”
print(text[4:9])
on Pr
text = “Python Programing”
print(text[:5])
Pytho
text = “Python Programing”
print(text[:-2])
Python Programi
text = “Python Programing”
print(text[-2:])
ng
text = “Python Programing”
print(text[-5:-3])
am
text = “Python Programing”
print(text[:-5])
Python Progr
text = “Python Programming”
print(text[4:91])
on Programming
text = “Python Programing”
print(text[:])
Python Programming
text = “YoU’re wELCome”
text.capitalize()
You’re welcome
text = “YoU’re wELCome”
text.lower()
you’re welcome
text = “YoU’re wELCome”
text.title()
You’Re Welcome
Explain:
text. isdigit()
text. isalpha()
text. isalnum()
- isdigit: string are digits
- isalpha: string are alphabetic
- isalnum: digits or alphabetic
text = “Python Programing”
print(text[::2])
Pto rgaig
text = “Python Programing”
print(text[::-1])
gnimargorP nohtyP