CJCoding With Joseph
15free / daySign inCreate account
← Back to Question List
Python Code Walkthrough #6

Dollar Signs And Decimals

mediumPrinting

📄 Code

Read carefully — what does this print?
1price: float = 4.5
2count: int = 3
3print('Total:', price * count, sep=' $')
4print(f'Each: {price}', f'Count: {count}', sep=' | ')
5print(f'{price * count:0.2f}', end='')
6print(' paid')
7print(f'{count} x {price} = {count * price}')

🎯 Your Answer