first_name = "Rick"
last_name = "Grimes"
print("My", "name", "is", first_name, last_name, sep=" ")
# -> My name is Rick Grimes
print("My", "name", "is", first_name, last_name, sep=":")
# -> My:name:is:Rick:Grimes
In the code snippet, we are printing different values and passing separator using sep="" syntax. In the first example, we are printing values with a space separator and in the second example we are using separator ":".
0 Comments