Python - String Handling
Questions No: 1/50

What will be the output of the following Python code?

print('abcdefcdgh'.partition('cd'))

Questions No: 2/50

What will be the output of the following Python code?

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

Questions No: 3/50

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

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

Questions No: 4/50

What will be the output of the following Python code?

print('a B'.isalpha())

Questions No: 5/50

What will be the output of the following Python code?

print("abc DEF".capitalize())

Questions No: 6/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: 7/50

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

Questions No: 8/50

What will be the output of the following Python code?

x = 'abcd'
for i in x:
    print(i)
    x.upper()

Questions No: 9/50

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

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

Questions No: 10/50

If wd="Hello World" then which of the following statements will display last five characters of the string object?

Questions No: 11/50

What is the output of the following code? print(len("Python\nProgramming"))
निम्नलिखित कोड का आउटपुट क्या है? print(len("Python\nProgramming"))

Questions No: 12/50

What will be the output of the following expression?

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

Questions No: 13/50

What is the output of the following program:

print ("Hello World"[::-1])

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 snippet?

print('Ab!2'.swapcase())

Questions No: 16/50

"hello,world".[-6], what value print?
"hello,world".[-6], का आउटपुट क्या होगा?

Questions No: 17/50

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

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

Questions No: 18/50

What will be the output of the following Python code?

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

Questions No: 19/50

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

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

Questions No: 20/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: 21/50

What will be the output of the following Python code?

print('xyxxyyzxxy'.lstrip('xyy'))

Questions No: 22/50

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

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

Questions No: 23/50

What will be the output of the following Python code?

print("xyyzxyzxzxyy".count('xyy', 2, 11))

Questions No: 24/50

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

Questions No: 25/50

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

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

Questions No: 26/50

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

Questions No: 27/50

What will be the output of the following Python code?

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

Questions No: 28/50

Which function returns the exact copy of the string with the first letter in uppercase.
कौन सा फंक्शन अपरकेस में पहले अक्षर के साथ स्ट्रिंग की सटीक प्रतिलिपि देता है।

Questions No: 29/50

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

Questions No: 30/50

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

Questions No: 31/50

When we open file in append mode the file pointer is at the of the file?
जब हम फाइल को एपेंड मोड में खोलते हैं तो फाइल पॉइंटर फाइल के ____ पर होता है?

Questions No: 32/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: 33/50

What will be the output of the following Python code?

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

Questions No: 34/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: 35/50

What will be the output of the following Python code?

example = "NITIN"
print(example.rfind("N"))

Questions No: 36/50

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

Questions No: 37/50

Which of the following will return reverse string str1?
निम्नलिखित में से कौन रिवर्स स्ट्रिंग str1 रिटर्न करेगा?

Questions No: 38/50

What does the following code print ?

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

Questions No: 39/50

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

print('11'.isnumeric())

Questions No: 40/50

What will be the output of the following Python code?

print(max("what are you"))

Questions No: 41/50

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

print(''.isdigit())

Questions No: 42/50

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

print('abcdefcdghcd'.split('cd', -1))

Questions No: 43/50

What will be the output of the following Python code?

print("xyyzxyzxzxyy".count('xyy', -10, -1))

Questions No: 44/50

What will be the output of the following Python code?

>>>max("what are you")

Questions No: 45/50

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

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

Questions No: 46/50

What will be the output of the following Python code?

print("Welcome to Python".split())

Questions No: 47/50

Each individual character in a string can be accessed using a technique called _____ .
एक स्ट्रिंग में प्रत्येक इनडिविजुअल कैरेक्टर को ____ ...नामक तकनीक का उपयोग करके एक्सेस किया जा सकता है

Questions No: 48/50

What will be the output of the following Python code?

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

Questions No: 49/50

What will be the output of the following Python code?

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

Questions No: 50/50

What will be the output of the following Python code?

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