If I have a list of both integers and floats and I print it, is there a way to print the integers without a decimal place but keep it for the floats?
I created a game based on the cards in a deck where different cards have different values. The value of each card is then multiplied by either 2, 1.5, 1 or 0.5 based on the suit. This is done randomly. This process is repeated 10 times.
The code looks something like this:
Scores = [2, 4, 6, 8, 10, 12, 15]
Suits = [2, 1.5, 1, 0.5]
TScore = 0
for each in range(10):
Score = random.choice(Scores)
Suit = random.choice(Suits)
TScore = Score * Suit
print("Your score is {0}".format(TScore))
The console may print something like this:
Your score is 12
Your score is 22.5
Your score is 18.0
Your score is 15
Your score is 30
Your score is 6.0
Your score is 6.0
Your score is 6.0
Your score is 12
Your score is 6
Is there a way to make sure that the integers are not followed by a decimal point?