Mbed Technologies
Learn, Develop, Compete

Welcome Mbed Quizes!! We update the Python quizes and answers on daily basis for our customers. Keep visiting this page on regular basis for thorough learning of the Python Programming Language and its applications.

P1 Program
``````
#!/usr/bin/python

def str1():
S1 = "4+9"
return S1

if __name__ == '__main__':
Sout = str1()
print ("String is:",Sout)
``````
P2 Program
``````
#!/usr/bin/python

def str1():
S1 = 4+9
return S1

if __name__ == '__main__':
Sout = str1()
print ("String is:",Sout)
``````
P3 Program
``````
#!/usr/bin/python

def str1():
S1 = '4+9'
return S1

if __name__ == '__main__':
Sout = str1()
print ("String is:",Sout)
``````
P4 Program
``````
#!/usr/bin/python

def str1(str):
return len(str)

if __name__ == '__main__':
str = 'bottle'
Lout = str1(str)
print ("Value is:",Lout)
``````
P5 Program
``````
#!/usr/bin/python

def slicing(str):
S = str[1:5]
return S

if __name__ == '__main__':
str = "bottleneck"
Mr = slicing(str)
print ("String is:",Mr)
``````
P6 Program
``````
#!/usr/bin/python

def slicing(str):
S = str[1:]
return S

if __name__ == '__main__':
str = "bottleneck"
Mr = slicing(str)
print ("String is:",Mr)
``````
P7 Program
``````
#!/usr/bin/python

def slicing(str):
S = str[-1]
return S

if __name__ == '__main__':
str = "bottleneck"
Mr = slicing(str)
print ("String is:",Mr)

``````
P8 Program
``````
#!/usr/bin/python

def slicing(str):
S = str[-2]
return S

if __name__ == '__main__':
str = "bottleneck"
Mr = slicing(str)
print ("String is:",Mr)

``````
P9 Program
``````
#!/usr/bin/python

def slicing(str):
S = str[:1]
return S

if __name__ == '__main__':
str = "bottleneck"
Mr = slicing(str)
print ("String is:",Mr)

``````
P10 Program
``````
#!/usr/bin/python

def slicing(str):
S = str[:2]
return S

if __name__ == '__main__':
str = "bottleneck"
Mr = slicing(str)
print ("String is:",Mr)
``````