I wish to understand the output of print((x,y)*5). I wish to know what actually is happening behind the scenes. (To me, it seems as if it turned into a list. Am I right?)
x = 'Thank'
y = 'You'
print(x+y)
print(x,y)
print((x+y)*5)
print((x,y)*5) #This one..
I am a beginner in Python and I'm asking a question for the first time ever. Please forgive me if this question seems naive. I tried Googling but it didn't help.
x+yconcatenate and print it 5 times, whilex,yare two seperate values and are multiplied 5 times alternatively and displayed as list. so its likexfirst thenyat second place upto 5 timesprint("ab" + "ra" + "ca" + "da" + "bra")vsprint("ab","ra","ca","da","bra")vsprint("ab","ra","ca","da","bra", sep = "WUSH")- seperate entities are printed withsepbetween - concattenated strings are printed as one concatted string. And printing tuples (not lists) should be obvious.