Q. Write the output of the following Python program code:


Str2 = list ("Cam@123*")

for i in range (len (Str2)-1):

    if i == 5:

        Str2[i] = Str2[i]*2

elif (Str2[i].isupper()):

    Str2[i] = Str2[i]*2

elif (Str2 [i].isdigit()):

    Str2 [i] = 'D'

print(Str2)


Answer :-

['CC', 'a', 'm', '@', 'D', '22', 'D', '*']
>>>

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post