Strings
1.
What will be the output of above Python code?
str1="6/4"
print("str1")
2.
Which of the following will result in an error?
str1="python"
3.
Which of the following is False?
4.
What will be the output of below Python code?
str1="Information"
print(str1[2:8])
5.
What will be the output of below Python code?
str1="Aplication"
str2=str1.replace('a','A')
print(str2)
6.
What will be the output of below Python code?
str1="poWer"
str1.upper()
print(str1)
7.
What will the below Python code will return?
If str1="save paper,save plants"
str1.find("save")
8.
What will the below Python code will return?
list1=[0,2,5,1]
str1="7"
for i in list1:
str1=str1+i
print(str1)
9.
Which of the following will give "Simon" as output?
If str1="John,Simon,Aryan"
10.
What will following Python code return?
str1="Stack of books"
print(len(str1))