Worksheetspython 3
Total questions: 10
Worksheet time: 5mins
str="world of python programming"
len(str)
24
25
27
28
str="world of python programming"
print(str[0:5])
world
word
wold
wolrd
str="world of python programming"
print(str[::-2])
gimopnhy odrw
gimronhy odrw
gimropnhy odr
gimropnhy odrw
str="world of python programming"
print(str.capitalize())
World of Python Programming
World of python Programming
World of python programming
World of Python programming
str="world of python programming"
str+=" store"
print(str)
world of python programmingstore
world of python programming store
world of python programming store
World of python programming store
str="world of python programming"
str+=" store"
str.replace('o','O')
'wOrld Of python prOgramming stOre'
'wOrld Of pythOn prOgramming store'
'wOrld Of pythOn prOgramming stOre'
'wOrld Of pythOn programming stOre'
str="world of python programming"
str.upper()
'WORLD OF PYTHON PROGRAMMING STORE'
'WORLD OF PyTHON PROGRAMMING STORE'
'WORLD OF PYTHON PROGRaMMING STORE'
'WORLD oF PYTHON PROGRAMMING STORE'
ch=99
print(chr(ch))
c
b
a
d
>>>str="computer"
>>> str1='science'
>>> str3=str+str1
>>> print(str3)
computerscience
'computerscience'
"computer"'science'
"computerscience"
str="computer"
print(str[-6:-1])
mpute
ompute
mputer
mputr
