Python - String Handling
Questions No: 1/50

what will the output of following code

my_string="Hello,world"
print(my_string[-6:-1])

Questions No: 2/50

Which of the following function returns the index value of first occurrence of substring occurring in the given string.
निम्नलिखित में से कौन सा फंक्शन दिए गए स्ट्रिंग में होने वाली सबस्ट्रिंग के पहले अकरेन्स की इन्डेक्स वैल्यू देता है।

Questions No: 3/50

What will be the output of the following Python code snippet?

a = [0, 1, 2, 3]
for a[0] in a:
    print(a[0])

Questions No: 4/50

What does the following code print ?

x = 'mohan'
for i in range (len(x)):
       x[i].upper()
print (x)

Questions No: 5/50

What will be the output of the following Python code?

print('abcd'.partition('cd'))

Questions No: 6/50

What is the output of >>>’2’ +’3’
>>>'2' +'3' का आउटपुट क्या है

Questions No: 7/50

What will be the output of the following Python code?

print('1Rn@'.lower())

Questions No: 8/50

What will be the output of the following Python code?

example = "snow world"
example[3] = 's'
print (example)

Questions No: 9/50

Which of the following methods is used to check if a string starts with a specific prefix?
निम्नलिखित में से किस मेथड का यूज़ यह चेक करने के लिए किया जाता है कि कोई स्ट्रिंग किसी स्पेसिफ़िक प्रीफ़िक्स से स्टार्ट होती है या नहीं?

Questions No: 10/50

What does the function re-search do?
फंक्शन re-search क्या करता है?

Questions No: 11/50

What will be the output of the following Python code snippet?

print('Hello World'.istitle())

Questions No: 12/50

What will be the output of the following Python code snippet?

print(''.isdigit())

Questions No: 13/50

Which method is used to access some part of a string or substring.
स्ट्रिंग या सबस्ट्रिंग के कुछ भाग को एक्सेस करने के लिए किस विधि का उपयोग किया जाता है।

Questions No: 14/50

What will be the output of the following Python code snippet?

print('abcefd'.replace('cd', '12'))

Questions No: 15/50

What will be the output of the following Python code?

string = "my name is x"
for i in string:
    print (i, end=", ")

Questions No: 16/50

What will be the output of the following Python code snippet?

print('abef'.partition('cd'))

Questions No: 17/50

What does s.count('a') return?
s.count('a') क्या return करता है?

Questions No: 18/50

What will be the output of the following Python code snippet?

print('xyyxyyxyxyxxy'.replace('xy', '12', 100))

Questions No: 19/50

What will be the output of the following Python code snippet?

print('abc'.islower())

Questions No: 20/50

What will be the output of the following Python code?

print('abcdef'.partition('cd'))

Questions No: 21/50

What does the strip() method do in Python?
पायथन में स्ट्रिप() विधि क्या करती है?

Questions No: 22/50

What will be the output of the following Python code?

print("abc DEF".capitalize())

Questions No: 23/50

split( ) function returns the _____ of words delimited by the specified substring.
स्प्लिट() फंक्शन निर्दिष्ट सबस्ट्रिंग द्वारा सीमांकित शब्दों का ____ देता है।

Questions No: 24/50

What will be the output of the following Python code?

print('Hello!2@#World'.istitle())

Questions No: 25/50

What will be the output of the following Python code?

print('ab'.isalpha())

Questions No: 26/50

What will be the output of the following Python code snippet?

print('ab cd-ef'.title())

Questions No: 27/50

What will be the output of the following Python code?

print("abcdef".find("cd") == "cd" in "abcdef")

Questions No: 28/50

Which predefined Python function is used to find length of String()
किस पूर्वनिर्धारित पायथन फंक्शन का उपयोग लंबाई को फाइन्ड के लिए किया जाता है।

Questions No: 29/50

What will be the output of the following Python code snippet?

print('1.1'.isnumeric())



Questions No: 30/50

lstrip() method is used for :
lstrip () फंक्शन का उपयोग इसके लिए किया जाता है:

Questions No: 31/50

If no delimiter is given in split() function then words are separated by
यदि split () फंक्शन में कोई डेलीमीटर नहीं दिया गया है तो शब्दों को ____द्वारा अलग किया जाता है

Questions No: 32/50

Which function removes whitespaces from both ends?
दोनों ends से whitespace हटाने वाला function कौन-सा है?

Questions No: 33/50

which of the following are valid string manipulation function in python
निम्नलिखित में से कौन सा पायथन में मान्य स्ट्रिंग मैनिपुलेशन फ़ंक्शन है

Questions No: 34/50

What will be the output of the following Python code snippet?

print('abcdefcdghcd'.split('cd', 2))

Questions No: 35/50

What will be the output of the following expression?

a = 2
b = 8
print(a|b )
print(a >> 1)

Questions No: 36/50

What will be the output of the following Python code?

print("abcdef".find("cd"))

Questions No: 37/50

What will be the output of the following Python code?

 x = "abcdef"
i = "a"
while i in x[:-1]:
    print(i, end = " ")

Questions No: 38/50

What will be the output of the following Python code snippet?

print('abcdefcdghcd'.split('cd'))

Questions No: 39/50

What will be the output of the following Python code snippet?

x = 'abcd'
for i in range(len(x)):
    x[i].upper()
print (x)

Questions No: 40/50

What will be the output of the following Python code snippet?

print('11'.isnumeric())

Questions No: 41/50

What will be the output of the following Python code snippet?

print('HelloWorld'.istitle())

Questions No: 42/50

Which of the following function returns True if the string is non empty and has all uppercase alphabets.
यदि स्ट्रिंग नॉन-इम्पटी है और सभी अपरकेस अक्षर हैं, तो निम्न में से कौन सा फंक्शन सही है।

Questions No: 43/50

Which of the following is true about Python strings?
पायथन स्ट्रिंग्स के बारे में निम्नलिखित में से कौन सा सत्य है?

Questions No: 44/50

What is the output?

s = "Python"
print(s[-1:-4])

Questions No: 45/50

What will be the output of the following Python code?

print("xyyzxyzxzxyy".count('yy', 1))

Questions No: 46/50

Which string slicing expression gives the output 'yth' from 'python'?
'python' expression से 'yth' प्राप्त करने के लिए कौन-सी slicing expression सही है?

Questions No: 47/50

What will be the output of the following Python code?

print("xyyzxyzxzxyy".endswith("xyy"))

Questions No: 48/50

What will be the output of the following Python code?

string = "my name is x"
for i in string.split():
    print (i, end=", ")

Questions No: 49/50

Given a string s="Welcome", which of the following code is incorrect ?
एक स्ट्रिंग s="Welcome" में निम्नलिखित में से कौन सा कोड गलत है?

Questions No: 50/50

What will be the output of the following Python code snippet?

print('abef'.replace('cd', '12'))