0

Print Int + String in one line

Hi. I don‘t get it. how can i Print print(chips) print("chips after bet") In one line in Python? Chips is an integer. Thanks.

2nd Jul 2018, 12:31 PM
Daniel
Daniel - avatar
9 odpowiedzi
+ 8
Your welcome Daniel I do not even know Python However I know there is ways of showing ints and strings together from other languages I just found the answer online 😂
2nd Jul 2018, 1:21 PM
Agent
Agent - avatar
+ 6
Using comma x = 8 print("The number is", x) OR Convert int x to string x = 8 print("The number is " + str(x)) OR using %s which will be replaced by x in the string x = 8 print("The number is %s" % x)
2nd Jul 2018, 12:41 PM
Agent
Agent - avatar
+ 2
now i can make my roulette code more beautiful https://code.sololearn.com/cN871sJvQVa9/?ref=app
2nd Jul 2018, 12:51 PM
Daniel
Daniel - avatar
+ 1
thanks. i will try this 👏
2nd Jul 2018, 12:45 PM
Daniel
Daniel - avatar
+ 1
thanks agent. was this teached at the beginning of the python course?
2nd Jul 2018, 12:50 PM
Daniel
Daniel - avatar
+ 1
😂👏
2nd Jul 2018, 1:36 PM
Daniel
Daniel - avatar
0
the output looks much better now. i mentioned you 2 in my code now 😀👏 https://code.sololearn.com/cN871sJvQVa9/?ref=app
2nd Jul 2018, 8:24 PM
Daniel
Daniel - avatar