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.
9 Answers
+ 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)
+ 2
now i can make my roulette code more beautiful
https://code.sololearn.com/cN871sJvQVa9/?ref=app
+ 1
have a look at string formatting
https://www.digitalocean.com/community/tutorials/how-to-use-string-formatters-in-JUMP_LINK__&&__python__&&__JUMP_LINK-3
+ 1
thanks. i will try this đ
+ 1
thanks agent. was this teached at the beginning of the python course?
+ 1
đđ
0
the output looks much better now. i mentioned you 2 in my code now đđ
https://code.sololearn.com/cN871sJvQVa9/?ref=app