String in Python
Qus. 1 : <p>What will be the output of the following Python code?</p><pre><span style="font-size: 14px;">x = "abcdef"<br></span><span style="font-size: 14px;">i = "a"<br></span><span style="font-size: 14px;">while i in x:<br></span><span style="font-size: 14px;"> x = x[:-1]<br></span><span style="font-size: 14px;"> print(i, end = " ")</span></pre>
- i i i i i i
- a a a a a a
- a a a a a
- none of the mentioned
- a a a a a
- a a a a a a
- a a a a a a … infinite Time
- a
- a a a a a a
- a
- no output
- error
- a B C D
- a b c d
- A B C D
- error
- abcd
- ABCD
- error
- none of the mentioned
- m, y, , n, a, m, e, , i, s, , x,
- m, y, , n, a, m, e, , i, s, , x
- my, name, is, x,
- error
- m, y, , n, a, m, e, , i, s, , x,
- m, y, , n, a, m, e, , i, s, , x
- my, name, is, x,
- error
- 0 1 2 3
- 0 1 2 2
- 3 3 3 3
- error
- dlrowolleh
- hello
- world
- helloworld
- snow
- snow world
- Error
- snos world
- error
- u
- t
- y
- Error
- -1
- 1
- 0
- -1
- 4
- 3
- 1
- abc def
- ABC DEF
- Abc def
- Abc Def
- 2
- 0
- 1
- none of the mentioned
- 2
- 0
- 1
- error
- 2
- 0
- 1
- error
- 1
- True
- 3
- 2
- 0
- 1
- True
- False
- True
- False
- Error
- None of the mentioned
- True
- 2
- 3
- None of the mentioned
- True
- False
- None
- Error
- True
- False
- None
- Error
- True
- False
- None
- Error
- True
- False
- None
- Error
- True
- False
- None
- Error
- True
- False
- None
- Error
- True
- False
- None
- Error
- True
- False
- None
- Error
- True
- False
- None
- Error
- True
- False
- None
- Error
- True
- False
- None
- error
- error
- zxxyxyy
- z
- zxxy
- zxxy
- xyxxyyzxxy
- xyxzxxy
- none of the mentioned
- (‘ab’, ‘ef’)
- (‘abef’)
- (‘ab’, ‘cd’, ‘ef’)
- 2
- (‘ab’, ‘cd’, ‘ef’, ‘cd’, ‘gh’)
- (‘ab’, ‘cd’, ‘efcdgh’)
- (‘abcdef’, ‘cd’, ‘gh’)
- error
- (‘ab’, ‘cd’, ”)
- (‘ab’, ‘cd’)
- error
- none of the mentioned
- (‘cd’)
- (”)
- (‘cd’, ”, ”)
- (”, ‘cd’, ”)
- (‘abef’)
- (‘abef’, ‘cd’, ”)
- (‘abef’, ”, ”)
- error
- ab12ef12
- abcdef12
- ab12efcd
- none of the mentioned
- abef
- 12
- error
- none of the mentioned
- ab1ef2
- abcefd
- ab1efd
- ab12ed2
- xyyxyyxyxyxxy
- 12y12y1212x12
- none of the mentioned
- error
- [‘ab’, ‘ef’, ‘gh’]
- [‘ab’, ‘ef’, ‘gh’, ”]
- (‘ab’, ‘ef’, ‘gh’)
- (‘ab’, ‘ef’, ‘gh’, ”)
- [‘abcdefcdghcd’]
- ‘abcdefcdghcd’
- error
- none of the mentioned
- [‘ab’, ‘ef’, ‘gh’]
- [‘ab’, ‘ef’, ‘gh’, ”]
- (‘ab’, ‘ef’, ‘gh’)
- (‘ab’, ‘ef’, ‘gh’, ”)
- [‘ab’, ‘ef’, ‘ghcd’]
- [‘ab’, ‘efcdghcd’]
- [‘abcdef’, ‘ghcd’]
- none of the mentioned
- AB!@
- ab12
- aB!2
- aB1@
- Ab cd ef
- Ab cd eF
- Ab Cd Ef
- None of the mentioned
- Ab cd-ef
- Ab Cd-ef
- Ab Cd-Ef
- None of the mentioned
- [“Welcome”, “to”, “Python”]
- (“Welcome”, “to”, “Python”)
- {“Welcome”, “to”, “Python”}
- “Welcome”, “to”, “Python”
- wd[4:]
- wd[:4]
- wd[-5:]
- wd[:-4]
- delete all the trailing whitespace characters
- delete all the leading whitespace characters
- delete all the leading and trailing whitespace characters
- delete upper case characters
- mohan
- MOHAN
- Error
- None of These
- 23
- '2+3'
- '23'
- None of These
- 10 0
- 10 2
- 2 2
- 10 1
- anywhere in between the file
- End
- beginning
- second line of the file
- 'm+nl'
- 'mn1'
- 'm n1'
- 'm'
- count()
- strip()
- upper()
- उपरोक्त सभी
- length
- length()
- len()
- None
- indexing
- Replication
- concatenation
- None of the Above
- Concatenation
- Membership
- Slicing
- All of the above
- slicer
- Slicing
- Membership
- None of these-
- empty string
- complete string
- string of six characters
- None of the above
- matches a pattern at the start of the string.
- matches a pattern at any position in the string.
- such a function does not exist
- none of the mentioned
- 5
- 6
- 11
- None
- matches a pattern at the start of the string.
- matches a pattern at any position in the string.
- such a function does not exist
- none of the mentioned.
- islower()
- isupper()
- Islower()
- None
- str1[ : : -1 ]
- str1[ : : 1 ]
- str1[ : -1 : -1 ]
- None
- find()
- copy()
- upper()
- capitalize()
- List
- Tuple
- Dictionary
- None
- space
- colon
- semi colon
- None
- index()
- find()
- Both of the above
- None of the above
- ,worl
- worl
- world
- oworld
- what
- y
- a
- Error
- White Space
- ,
- e
- S
- count()
- upper()
- strip()
- All the above
- dlroW olleH
- Hello Worl
- D
- error
Programs
python program to find the 2nd largest number from the list of the numbers entered through keyboard.
python program that creates a list of numbers from 1 to 20 that are divisible by 4
python program to define a list of countries that are a member of BRICS Check whether a county is member of BRICS or not
Python program to read marks of six subjects and to print the marks scored in each subject and show the total marks
Python program to read prices of 5 items in a list and then display sum of all the prices product of all the prices and find the average
Python program to count the number of employees earning more than 1 lakh per annum
python program to create a list of numbers in the range 1 to 10 Then delete all the even numbers from the list and print the final list
python program to generate in the Fibonacci series and store it in a list Then find the sum of all values
python program to swap two values using tuple assignment
python program using a function that returns the area and circumference of a circle whose radius is passed as an argument
python program that has a list of positive and negative numbers Create a new tuple that has only positive numbers from the list
Python Program that generate a set of prime numbers and another set of even numbers
python program to find minimum element from a list of elements along with its index in the list
Python program to calculate mean of a given list of numbers
Python program to search for an element in a given list of numbers
python program to count frequency of a given element in a list of numbers
python program to calculate the sum of integers of the list
python program to reverses an array of integers
python program to creates a third list after adding two lists
python program to store the product information in dictionary
python program to create a dictionary whose keys are month names and values are their corresponding number of days
python program that input a list, replace it twice and then prints the sorted list in ascending and descending order
python program to check if the maximum element of the list lies in the first half of the list or in the second half
python program to display the maximum elements from the two list along with its index in its list
python program to swap list elements with even and locations
python program to rotate list elements with next elements
python program to find maximum and minimum values in tuple
python program to interchange the values of two tuple
python program to interchange the values of two tuple
python program to increment the elements of list
python program to enter a list containing number between 1 and 12 then replace all the entries in the list that are greater than 10 with 10
python program that reverse the list of integers in place
python program to input two list and create third list which contains all elements of the first elements followed by all elements of second list
python program to inter list of string and create a new list that consist of those strings with their first characters removed
python program to create a list using for loop which consist of integers 0 through 49
python program to create a list using for loop which consist square of the integers 1 through 50
python program to create a list using for loop which consist a bb ccc dddd that ends with 26 copies of the letter z.
python program that takes any two list L and M of the same size and adds their elements together in another third list
python program to rotates the elements of list so that fist elements move to second and second to the third
python program to move all duplicate element to the end of list
python program to display the maximum and minimum values form specified range of indexes of a list
python program to compare two equal sized list and print the first index where they differ
python program to enter names of employees and their salaries as input and store them in a dictionary
python program to count the number of times a character appears in a given string
python program to convert a number entered by the user into its corresponding number in words
python program Repeatedly ask the user to enter a team name
python program that repeatedly asks the user to enter product names and prices
Python Program to Create a dictionary whose keys are month name and whose values are number of days in the corresponding month
python program to store the detail of 10 students in a dictionary at the same time
python program to Create a dictionary with the opposite mapping
python program that lists the over lapping keys of the two dictionaries if a key of d1 is also a key of d2 the list it
python program that checks if two same values in a dictionary have different keys
python program to check if a dictionary is contained in another dictionary
python program to create a new dictionary D2 having same keys as D1 but values as the sum of the list elements
python program to create a dictionary has three keys assets liabilities and capital
python program that create a tuple storing first 9 terms of Fibonacci series
python program that receives the index and return the corresponding value
Python program that receives a Fibonacci series term and returns a number telling which term it is
python program to create a nested tuple to store roll number name and marks of students
python program that interactively creates a nested tuple to store the marks in three subjects for five students
Python Program to accept three distinct digits and print all possible combinations from the digits
Python Program to find the successor and predecessor of the largest element in list
Python function that takes a string as parameter and returns a string with every successive repetitive character replaced