|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
what wrong with this program it won't work
import random
die1 = random.randrange(6)+1 die2 = random.randrange(6)+1 total = die1 + die2 raw_input('press the enter key to exit') |
|
#2
|
|||
|
|||
|
Works for me; although it really doesn't 'do' anything. What were you expecting?
Try Code:
import random
die1 = random.randrange(6)+1
die2 = random.randrange(6)+1
total = die1 + die2
print die1, die2, total
raw_input('press the enter key to exit')
__________________
BookMooch.com : Give books away. Get books you want. |
|
#3
|
||||
|
||||
|
I dont see a problem here either although you might want to try the randint() function instead. Geeks right though, this doesn't really do anything anyway so its kinda hard to guess what you want
. Gonna give us a hint?Mark. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > what wrong with this program it won't work |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|