Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.
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
2 months, 4 weeks agoArulkumar
1 year agoSuvabrata
1 year, 10 months ago666_m
1 year, 11 months agomacxsz
1 year, 11 months agosmarty_arse
2 years, 3 months agoNoarmy315
2 years, 3 months agopypaul
3 years, 5 months ago