1
>>> income = 50
>>> print("Your income tax is $",income,".")
Your income tax is $ 50 .

So how do I print "$ 50 ." together?

okKANMANI
  • 23
  • 2
  • 6

3 Answers3

3

You can use the sep argument to print:

>>> income = 50000
>>> print("Your income tax is $", income, ".", sep='')
Your income tax is $50000.

Or use the str.format:

>>> print("Your income tax is ${}.".format(income))
Your income tax is $50000.
AChampion
  • 29,683
  • 4
  • 59
  • 75
1

You can also do something like this:

x = 50
x = str(x)
y = 'Your Income is $'
z='.'
print(y+x+z)

Output: Your Income is $50.

DaNNuN
  • 328
  • 1
  • 3
  • 12
0

Use string formatting:

print("Your income tax is ${0}.".format(income))
Robᵩ
  • 163,533
  • 20
  • 239
  • 308