Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Time to get started on Python homework...
#19
Heidi Wrote:So does it mention about what functions, parameters, return values, etc are?

Considering the pages being "very long", I'd assume yes. Who could write pages on introduction to programming without those concepts?
Anyway, this is how you do it:

Instead of explicitly declaring the values like Fiel did
here
Code:
while len(randomNumbers) < 6:
and here
Code:
randomNumber = random.randint(1, 49)
, you implicitly refer to those numbers via variables:
Code:
while len(randomNumbers) < totalLotteryLength:
and
Code:
randomNumber = random.randint(1, UpperRandomNumberLimit)
.

Where do you get these numbers? From the user, as instructed. So ask the user for the inputs and store their answers into the variables.
Reply


Messages In This Thread
Time to get started on Python homework... - by Kalovale - 2011-10-22, 09:11 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)