Can you solve this? Python QUIZ #19 #pythonprogramming #python #pythonquestions #shortyoutube

preview_player
Показать описание
I hope you like this video.

Thanks for watching Code to Win. #codetowin

Social Media Link -
Рекомендации по теме
Комментарии
Автор

You can only connect string with string.
If you wanna use string with int,
There's four ways.
(i is variable storing int.)
Solution 1: print("1"+str(i))
Solution 2: print("1%d"%i)
Solution 3: print("1{}".format(i))
Solution 4: print(f"1{i}")

I perfer to use solution 4, but for list, I perfer Solution 3.
Ex:

x = [1, 2, 3]
print("{}-{}-{}".format(*x))

_____JUNPark_____
join shbcf.ru