Following is an example of ___________________ sv = “csiplearninghub.com”
1.List
2.String
3.Dictionary
4.None of the above
Posted Date:-2021-12-11 07:38:56
Python allows _____________ operations on string data type.
1.Concatenation
2.Membership
3.Slicing
4.Slicing
Posted Date:-2021-12-11 11:52:47
str[5 : 11] will return ___________ character
1.5
2.6
3.11
4.None of the above
Posted Date:-2021-12-11 12:02:27
What is the index value of ‘i’ in string “Learning”
1.5
2.3
3.6
4.7
Posted Date:-2021-12-11 07:46:20
What type of error is returned by the following : str = "Learning" print(str[10])
1.Error in Index
2.Index out of range in string
3.IndexError
4.None of the above
Posted Date:-2021-12-11 07:47:48
What we call the following:
1.Escape Sequence
2.Special Character
3.Don’t have any common term
4.Keyword
Posted Date:-2021-12-11 07:45:02
Which operator is used for string concatenation?
1.*
2.//
3.+
4.-
Posted Date:-2021-12-11 10:38:43
Write the output of the following : >>> str1 = 'Hello World! Hello Hello' >>> str1.count('Hello')
1.1
2.2
3.3
4.4
Posted Date:-2021-12-11 12:22:56
Write the output of the following code : a = '''A B C''' print(a)
1.ABC
2.A BC
3. A B C
4.Error
Posted Date:-2021-12-11 07:45:57
Write the output of the following code : a="Learn" while(a): print(a)
1.L e a r n
2.Error
3.Infinite Loop
4.Learn
Posted Date:-2021-12-11 07:53:23
Write the output of the following code : for i in "STR": print(i)
1. S TR
2.STR
3.S T R
4.S T R
Posted Date:-2021-12-11 07:52:26
Write the output of the following: print('aisabisacisadisae'.split('isa',3))
1.[‘a’, ‘b’, ‘c’, ‘disae’]
2.[‘a’, ‘b’, ‘cisadisae’]
3. [‘a’, ‘b’, ‘c’, ‘d’, ‘e’]
4.None of the above
Posted Date:-2021-12-11 12:51:59
Write the output of the following. s = “hello 123” print(s.islower())
1.False
2.True
3.Error
4.None of the above
Posted Date:-2021-12-11 12:19:25
_________ method is used to access some part of a string or substring.>>> str1 = ‘Hello World!’ >>> ‘W’ in str1
1.Slicer
2.Slicing
3.Membership
4.None of the above
Posted Date:-2021-12-11 11:58:22
>>> “Hey!”.endswith(‘!’) will return ______
1.True
2.False
3.Error
4.None of the above
Posted Date:-2021-12-11 12:28:26
A _____________ can be created by enclosing one or more characters in single, double or triple quote
1. String
2.List
3.Tuple
4.Dictionary
Posted Date:-2021-12-11 11:43:15
Characters in a string can be _________ enclosed in quotes.
1.Digits
2.white space
3.letter
4.All the above
Posted Date:-2021-12-11 11:44:07
Content of string can not be changed, it means that string is
1.mutable
2.immutable
3.reversible
4.None of the above
Posted Date:-2021-12-11 11:50:05
Each individual character in a string can be accessed using a technique called _____
1.Indexing
2.Replication
3.Concatenation
4.None of the above
Posted Date:-2021-12-11 11:45:12
find( ) function returns ___________ if the substring is not present in the given string
1.0
2.1
3.-1
4.Error
Posted Date:-2021-12-11 12:26:52
Following code will return ? s = “Hello” print(s.count(‘l’,2,5))
1.2
2.3
3.1
4.None of the above
Posted Date:-2021-12-11 12:15:34
How many operators are used in the following statement? 7 + 4 * 8 // 2 ** 2 - 6 / 1
1.5
2.6
3.7
4.8
Posted Date:-2021-12-11 10:40:42
If no delimiter is given in split( ) function then words are separated by ____
1.space
2.colon
3.semi colon
4.None of the above
Posted Date:-2021-12-11 12:41:57
If we give index value out of the range then we get an ___
1.ValueError
2. SyntaxError
3. IndexError
4.Error
Posted Date:-2021-12-11 11:46:06
Index value in String should be of type ________________
1.Float
2.Integer
3.String
4.Boolean
Posted Date:-2021-12-11 07:47:08
index( ) function returns _______________ if the substring is not present in the given string
1.0
2.1
3.-1
4.Error
Posted Date:-2021-12-11 12:27:39
Name a function which is same as find() but raises an exception if the substring is not present in the given string.
1. index( )
2.endswith( )
3. startswith( )
4.count( )
Posted Date:-2021-12-11 12:17:06
Name the function which is used to find length of string.
1.length( )
2.len( )
3. strlen( )
4.slen( )
Posted Date:-2021-12-11 07:51:37
partition( ) function of string in python return the result in the form of ____
1.String
2.List
3.Tuple
4.Dictionary
Posted Date:-2021-12-11 12:39:31
partition() function divides the main string into ________ substring.
1.1
2.2
3.3
4.4
Posted Date:-2021-12-11 12:40:24
print(“aNd&*”.swapcase()) will display _
1.AnD*&
2.AnD&*
3. aNd&*
4.Error
Posted Date:-2021-12-11 12:53:58
Slice operation can also take a third parameter that specifies the _____
1. Starting index
2.Ending index
3.Step Size
4.None of the above
Posted Date:-2021-12-11 12:08:24
split( ) function returns the _______________of words delimited by the specified substring.
1.List
2.Tuple
3.Dictionary
4.None of the above
Posted Date:-2021-12-11 12:41:17
str[11 : 5] will return _________
1.empty string
2.complete string
3. string of six characters
4.None of the above
Posted Date:-2021-12-11 12:04:24
The index of the first character ____________ on the string is 0
1. from left
2.from right
3.from middle
4.None of the above
Posted Date:-2021-12-11 11:46:58
We can access each character of a string or traverse a string using ___
1.for loop only
2.while loop only
3.both of the above
4.conditional statement
Posted Date:-2021-12-11 12:11:29
What index value is returned by the following code? s = “Hello” print(s.find(‘l’))
1.2
2.3
3.4
4.-2
Posted Date:-2021-12-11 12:14:39
What type of error is returned by statement : >>> str[1.5]
1.SyntaxError
2.ValueError
3.. IndexErro
4.. TypeError
Posted Date:-2021-12-11 11:47:49
Which character will have same index value when you access elements from the beginning and from the end(ignore the negative sign) in the following string. s = “Welcome to my blog”
1.‘t’
2.‘ ‘
3. ‘o’
4. ‘t’
Posted Date:-2021-12-11 07:48:47
Which function in the following statement will execute first? print("amit".lower().upper())
1. print( )
2. lower( )
3. upper( )
4.None of the above
Posted Date:-2021-12-11 12:49:14
Which function in the following statement will execute last? print("amit".lower().upper())
1.print( )
2.lower( )
3.upper( )
4.None of the above
Posted Date:-2021-12-11 12:50:49
Which of the following function can take maximum three arguments/parameters?
1.find( )
2.index( )
3.count( )
4.All the above
Posted Date:-2021-12-11 12:46:36
Which of the following function removes only leading spaces from the string?
1.strip( )
2.lstrip( )
3. rstrip( )
4.Lstrip( )
Posted Date:-2021-12-11 12:45:53
Which of the following function return the integer value?
1.lower( )
2. upper( )
3.islower( )
4.find( )
Posted Date:-2021-12-11 12:47:32
Which of the following function returns the ASCII/Unicode value character?
1.asc( )
2.ord( )
3.asci( )
4. ascii( )
Posted Date:-2021-12-11 11:39:05
Which of the following function returns the index value of first occurrence of substring occurring in the given string.
1. index( )
2.. find( )
3.Both of the above
4.None of the above
Posted Date:-2021-12-11 12:26:08
Which of the following function returns the string with first letter of every word in the string in uppercase and rest in lowercase?
1.swapcase( )
2.upper( )
3.title( )
4.capitalize( )
Posted Date:-2021-12-11 12:13:15
Which of the following function returns True if the string is non-empty and has all uppercase alphabets.
1. islower( )
2. islower( )
3.Islower( )
4. islower( )
Posted Date:-2021-12-11 12:35:41
Which of the following is a mapping data type?
1.String
2.List
3.Tuple
4.Dictionary
Posted Date:-2021-12-11 11:41:51
Which of the following is correct slicing operation to extract every kth character from the string str1 starting from n and ending at m-1.
1.str1[: : k]
2.str1[n : m+1 : k]
3.str1[n : m : k ]
4.str1[m : n : k ]
Posted Date:-2021-12-11 12:10:01
Which of the following is not a String built in functions?
1. partition( )
2.isupper( )
3.lower( )
4.swapcases( )
Posted Date:-2021-12-11 10:49:45
Which of the following is not an inbuilt function of string?
1.length( )
2.find( )
3. endswith( )
4.split( )
Posted Date:-2021-12-11 12:48:27
Which of the following statement is correct in accessing each element of string?a) a="Learning" while(i): print(i) b) a="Learning" for i in a: print(i)
1. a only
2.b only
3.both a and b
4.None of the above
Posted Date:-2021-12-11 07:49:36
Which of the following statements will also return the same result as given statement? print(“Computer” + “Computer”)
1.print(“Computer” , ” “, “Computer”)
2.print(“Computer”,”Computer”)
3.print(“Computer” **2)
4.print(“Computer” * 2)
Posted Date:-2021-12-11 11:40:05
Which of the following will return reverse string str1?
1.str1[ : : -1]
2.str1[: : 1]
3.str1[: -1 : -1 ]
4.None of the above
Posted Date:-2021-12-11 12:10:34
Which of the function returns Boolean value?
1. find( )
2.index( )
3.endwith( )
4.endswith( )
Posted Date:-2021-12-11 12:29:14
Which operator is used with integers as well as with strings?
1./
2.//
3.**
4.*
Posted Date:-2021-12-11 07:54:15
Write the output of the following : >>> str1 = 'Hello World! Hello Hello' >>> str1.count('Hello',12,25)
1.1
2.2
3.3
4.4
Posted Date:-2021-12-11 12:22:20
Write the output of the following : >>> str1 = ‘HelloWorld!!’ >>> str1.isalnum()
1.False
2.True
3.Error
4.None of the above
Posted Date:-2021-12-11 12:21:46
Write the output of the following : print("Absbcbcgdbc".count("b",4))
1.1
2.2
3.3
4.4
Posted Date:-2021-12-11 12:23:31
Write the output of the following : print("Absbcbcgdbc".find("b",5))
1.1
2.2
3.5
4.6
Posted Date:-2021-12-11 12:23:58
Write the output of the following code : a= "Welcome to blog" print(a)
1.Welcome to blog
2.Welcome to blog
3.Welcome to blog
4.Error
Posted Date:-2021-12-11 07:42:52
Write the output of the following code : a= "Welcome to "my" blog" print(a)
1.Welcome to “my” blog
2.Welcome to ”my” blog
3.Error
4.None of the above
Posted Date:-2021-12-11 07:42:08
Write the output of the following code : for i in (1,2,3): print("@" * i)
1.Error
2.@@@@@@
3.@ @@ @@@
4.@ @ @ @ @ @
Posted Date:-2021-12-11 10:39:51
Write the output of the following code : s= "str" s1 = "string" print(s1 in s)
1.True
2.False
3.Error
4.None of the above
Posted Date:-2021-12-11 10:42:48
Write the output of the following code : s= "str" Write the output of the following code : for i in range(65,70): print(chr(i))
1.Error
2.TypeError
3.A B C D E
4.ABCDE
Posted Date:-2021-12-11 10:45:04
Write the output of the following code : s= "str" Write the output of the following code : for i in range(65,70): print(chr(i))
1.Error
2.TypeError
3.A B C D E
4.ABCDE
Posted Date:-2021-12-11 10:45:11
Write the output of the following code : s="blog" for i in range(-1,-len(s),-1): print(s[i],end="$")
1.g$o$l$b$
2.g$o$l$
3.Error
4.None of the above
Posted Date:-2021-12-11 10:42:03
Write the output of the following code : str = "Welcome" l=len(str) print(l)
1.6
2.7
3.8
4.Error
Posted Date:-2021-12-11 07:44:05
Write the output of the following code : str = "Welcome" str[2] = 'a' print(str)
1. Weacome
2.Error
3. aWelcome
4.Welcomea
Posted Date:-2021-12-11 07:43:34
Write the output of the following: >>> len(" python".lstrip()) #2 spaces are given before "python"
1.5
2.6
3.7
4.8
Posted Date:-2021-12-11 12:44:42
Write the output of the following: >>> str1 = 'hello ??' >>> str1.islower( )
1.NO
2.True
3.false
4.Error
Posted Date:-2021-12-11 12:32:45
Write the output of the following: >>> str1 = 'Hello World!' >>> str1.replace('o' , '*')
1.Hello World!’
2. ‘Hell* W*rld!’
3.‘Hello W*rld!’
4.Error
Posted Date:-2021-12-11 12:37:00
Write the output of the following: >>> str1 = 'hello WORLD!' >>> str1.title()
1. HELLO world
2.Hello World
3.Hello world
4.HeLlO WoRlD
Posted Date:-2021-12-11 12:21:04
Write the output of the following: >>> str1 = 'India is a Great is Country' >>> str1.partition('is')
1.(‘India ‘, ‘is’, ‘ a Great is Country’)
2.(‘India ‘, ‘is’, ‘a Great’, ‘is’, ‘Country’)
3.(‘India ‘, ‘is’, ‘ a Great Country’)
4.Error
Posted Date:-2021-12-11 12:37:39
Write the output of the following: >>> str1 = 'String MCQ' >>> str1.startswith('Str')
1.True
2.False
3.yes
4.No
Posted Date:-2021-12-11 12:29:59
Write the output of the following: "@".join("python")
1.p@y@t@h@o@n’
2.‘p@y@t@h@o@n@’
3.@p@y@t@h@o@n@’
4.‘@
Posted Date:-2021-12-11 12:44:10
Write the output of the following: "python".join("@")
1.‘p@y@t@h@o@n’
2.p@y@t@h@o@n@’
3.‘@p@y@t@h@o@n@’
4.@’
Posted Date:-2021-12-11 12:43:13
Write the output of the following: 2 + '3'
1. 2 3
2.23
3.SyntaxError
4.TypeError
Posted Date:-2021-12-11 10:37:35
Write the output of the following: a="We to my b ok" print(a)
1.We to my b ok
2.We to myb ok
3.Weto my b ok
4.None of the above
Posted Date:-2021-12-11 07:41:21
Write the output of the following: for i in range(len("python"),12,2): print("python"[i-6])
1.p t o
2.p y t h o n
3.y h n
4.p y t h
Posted Date:-2021-12-11 11:41:04
Write the output of the following: print('aisabisacisadisae'.split('isa'))
1.[‘a’, ‘b’, ‘c’, ‘disae’]
2.[‘a’, ‘b’, ‘cisadisae’]
3.[‘a’, ‘b’, ‘c’, ‘d’, ‘e’]
4.None of the above
Posted Date:-2021-12-11 12:52:49
Write the output of the following: print("Welcome-Python".isalnum())
1.True
2.False
3.yes
4.No
Posted Date:-2021-12-11 12:30:30
Write the output of the following: print(“A#B#C#D#E”.replace(“#”,”?”))
1.A#B#C#D#E
2.A?B?C?D?E
3.Can not replace as Strings are immutable
4.Error
Posted Date:-2021-12-11 10:46:53
Write the output of the following: print(“A#B#C#D#E”.split(“#”,2))
1.[‘A’, ‘B’, ‘C#D#E’]
2.[‘A#’, ‘B#’, ‘C#D#E’]
3. [‘A’, ‘B’, ‘C’ , ‘D’ , ‘E’]
4.Error
Posted Date:-2021-12-11 10:46:04
Write the output of the following: print(“I love my Country”.find(“o”,4))
1.3
2.12
3.11
4.3,11
Posted Date:-2021-12-11 10:47:54
Write the output of the following: print(len("\\\///"))
1.9
2.Error
3.3
4.6
Posted Date:-2021-12-11 11:37:53
Write the output of the following: print(str("WelcomePython".isalnum()).upper())
1.TRUE
2.True
3.FLAS
4.Error
Posted Date:-2021-12-11 12:31:29
Write the output of the following: s = ” Hello” print(s.find(‘a’))
1. 0
2.-1
3.1
4.Error
Posted Date:-2021-12-11 12:14:02
Write the output of the following: str = "Amit is a is a" s = str.partition('is') print(s[1])
1. is a
2.a
3.is
4.i
Posted Date:-2021-12-11 12:38:44
Write the output of the following. >>> str1 = ‘Hello World! Hello >>> str1.index(‘Hee’)
1.0
2.1
3.Error
4.None of the above
Posted Date:-2021-12-11 12:17:35
Write the output of the following. >>> str1 = ‘Hello World!’ >>> str1.endswith(‘World!’)
1.True
2.False
3.yes
4.Error
Posted Date:-2021-12-11 12:18:35
Write the output of the following. a = "Blog" a ='a' print(a)
1.Bloga
2.aBlog
3.Blog
4.a
Posted Date:-2021-12-11 07:40:01
Write the output of the following. print(‘#’.join(“12345”))
1.#12345
2.#12345#
3.1#2#3#4#5
4.1#2#3#4#5#
Posted Date:-2021-12-11 10:48:44
Write the output of the following. str = “python” print(str[2+1])
1. t
2.h
3.th
4.Error
Posted Date:-2021-12-11 11:48:35