48.0k views
3 votes
PLEASE HURRY!!!!

What can you change, if anything, in this line so that there will not be a space between the dollar sign and the amount of money due?

print("You owe $", moneyDue)

A) You do not need to change anything. There is no space.
B) print("You owe $" , str(moneyDue))
C) print("You owe $" + str(moneyDue))
D) The space cannot be removed.

2 Answers

3 votes

Answer:

print("You owe$" + str(moneyDue))

Step-by-step explanation:

It's the one with the plus sign. Correct on EDG 2021 :D

User Liesa
by
6.4k points
1 vote

Answer:

print("You owe $", moneyDue, sep="")

Step-by-step explanation:

By default, Python3 will put a space between two strings like this. If you specify that the separator is an empty string (sep="") then it will not separate the two strings and the space will go away.

User Kevin Robatel
by
6.0k points