how to print two variable values in same line separated by comma | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

how to print two variable values in same line separated by comma

14th Aug 2017, 8:28 AM
pulkit goel
pulkit goel - avatar
2 Réponses
0
There are a few ways to accomplish this. Here's one: print("{0}, {1}".format(var1, var2))
14th Aug 2017, 8:37 AM
ChaoticDawg
ChaoticDawg - avatar
0
print("{}, {}".format(a, b)) or print(a, ", ", b)
14th Aug 2017, 8:58 AM
clement
clement - avatar