x = "hello" * 2
print(x)
String Multiplication:
"hello" is a string.
2 is an integer.
When you multiply a string by an integer, the string is repeated that many times.
In this case, "hello" * 2 produces "hellohello", which is the string "hello" repeated twice.
Assignment:
The result "hellohello" is assigned to the variable x.
Print Statement:
The print(x) statement outputs the value of x, which is "hellohello".
0 Comments:
Post a Comment