+ 1
What should I do to print both Text and calculation in python ?
I know 6/2 is equal to 3. Can I print 'Question number 3' by writing print ('Question number' 6/2). What should I do to mix Text and calculation?
1 Réponse
0
Althrough there will be a mistake to write
print("Answer is "+6//2) or
print("Answer is " 6//2)
We can still declare a variable, make it string after calculations and then we just make it like this:
a=str(6//2)
print("Answer is "+a)
https://code.sololearn.com/c88oTl1b6WlD/?ref=app