Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old March 29th, 2004, 01:29 PM
perfect20002 perfect20002 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 28 perfect20002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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')

Reply With Quote
  #2  
Old March 29th, 2004, 02:04 PM
lnxgeek lnxgeek is offline
I AM A GOLDEN GOD
Dev Shed God (5000 - 5499 posts)
 
Join Date: Apr 2003
Location: cannot find symbol: method showLocation()
Posts: 5,400 lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level)lnxgeek User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 11 h 24 m 27 sec
Reputation Power: 685
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.

Reply With Quote
  #3  
Old March 29th, 2004, 08:23 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,529 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 19 m 5 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
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.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > what wrong with this program it won't work


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway