s='*****'
s= s - s[2] #TypeError: unsupported operand type(s) for -: 'str' and 'str'
print(s)
#For strings, only + ( concatenate ) and * (multiply) is allowed. TypeError will be returned
#TypeError: unsupported operand type(s) for -: 'str' and 'str'
#Ans: the code is erroneous
A is answers. The snippet wiill generate a TypeError
upvoted 4 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
seaverick
10 months agoArulkumar
1 year, 7 months agoSuvabrata
2 years, 5 months ago666_m
2 years, 6 months agomacxsz
2 years, 6 months agosmarty_arse
2 years, 10 months agoNoarmy315
2 years, 11 months agopypaul
4 years ago