Im writing a math game program in Python and I am having some difficulty with some parts of it. I am very new to Python so bear with me.
I have to display a math problem so it looks like this:
4 * * * *
+ 5 * * * * *
---
->9
my code for this part of the program is as follows:
print(ranNum1)
print("+",ranNum2)
print("---")
print("->",answer)
How would I go about displaying the * marks next to the numbers if the number in the problem are random?
Python Math Game
Page 1 of 11 Replies - 189 Views - Last Post: 06 December 2012 - 02:54 PM
Replies To: Python Math Game
#2
Re: Python Math Game
Posted 06 December 2012 - 02:54 PM
Go into your interpreter and type
Does that answer your question?
>>> n = 5 >>> '*' * n
Does that answer your question?
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|