+ 2
What is the answer of str="05"*5
11 Respostas
+ 16
str="05"*5 is not a question, but if you want to know what str looks like, why not trying it in the CodePlayground ?
str="05"*5
print(str)
+ 4
str="05"*5 means print 05 5 times
So ans is 0505050505
+ 3
"05" is printed 5 times since it is multiplied with 5
Output: 0505050505
+ 2
Aatif Fraz In Python strings and iterables can be multiplied with natural integers.
When you do that, you actually call a function of string or integer class (str*int => string class, int*str => integer class).
In Python you can define custom behavior for objects, when they interact with symbols and another object.
+ 1
0505050505
+ 1
What is the difference between the above answer in-between "05","05","05","05","05" or 0505050505
+ 1
0505050505 is an integer.
"05", "05", "05", "05", "05" is a sequence of string "05"s, can be a tuple or a function feed.
+ 1
Which answer I prefer for that question sir
+ 1
Try ur self ....Print Y.C.B Reddy
+ 1
You can use ("05",)*5 to get ("05", "05", "05", "05", "05")
+ 1
Shouldn't that result in an error? Isn't str a reserved word which shouldn't be used for variables like, just like int, and all?