Computer Science
Select the correct output of the following string operators.
str1='One'
print(str1[:3] + 'Two' + str1[-3:])
- OneOneTwo
- TwoOneOne
- OneTwoOne
- Error
Related Questions
Which of the following functions will return the first three characters of a string named 's'?
- s[3:]
- s[:3]
- s[-3:]
- s[:-3]
Observe the given code and select the appropriate output.
Tuple given: tup1 = (10, 20, 30, 40, 50, 60, 70, 80, 90)
What will be the output of: print(tup1[3:7:2])
- (40, 50, 60, 70, 80)
- (40, 50, 60, 70)
- (40, 60)
- Error
When a list is contained in another list as a member-element, it is called …………… .
- Nested tuple
- Nested list
- Array
- List
The …………… method removes the last entered element from the dictionary.
- pop()
- remove()
- popitem()
- del