> sorry for the self reply. I got motivated and largely got SPE to use
> the IDLE colour scheme. I've emailed it to Ismael. If anyone else want
> is, write me privately.
Just out of interest I use Ubuntu Linux and gedit is the editor.
Norman
___
Tut
> I’m one of the people new to Python who has started going through a
> beginner’s book to learn the basics of the language (“Python
> Programming for the Absolute Beginner”). In the second chapter the
> author (Michael Dawson) illustrates the use of escape sequences with,
> among other things,
> #Coin Toss Game
>
> print "This game will simulate 100 coin tosses and then tell you the
> number of head's and tails"
>
> import random
>
> tosses = 0
> heads = 0
> tails = 0
>
> while tosses = 100<0:
>coin = randrange(1)
>tosses +=1
>if coin == 0:
> heads +=1
> prin
> > Thank you for your comment which, if I understand you correctly, implies
> > that prime numbers greater than 25 will not be recognised. Surely, that
> > cannot be correct. However, if it is correct, could you please
> > demonstrate what you mean for my education.
>
> More precisely, it will g
On Mon, 2005-10-31 at 06:12 -0500, Kent Johnson wrote:
> Norman Silverstone wrote:
> > I am a beginner so, I hope what I give, makes sense. In it's simplest
> > form what is wrong with :-
> >
> > n = input("Enter a number")
> > if n % 2 != 0 and
> I am trying to write a program that will figure out if a number is prime
> or not. Currently this is the code that I have:
>
> import math
>
> def main():
>
> number=input("Please enter a positive whole number greater than 2: ")
> for value in range(2, number-math.sqrt):
> if
Yes I am going through the Michael Dawson book. Also, I am working from
the Alan Gauld book to reinforce my attempts at learning python.
Norman
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
This may not be up to the standard of the more experienced programmer
but here is my effort. An added bit is the ability to go on using the
code until you are fed up.
#To check the computers odds and evens
import random
anothergo = "y"
while(anothergo != "n"):
oddsevens = random.randrange(2
> I understand the format of while loops, but is it possible to use the
> random.randrange function in them?
>
> My goal, create a program that flips a coin 100 times, at the end it
> says the number of times it flipped heads and flipped tails.
I am also trying to learn python and came across
I am greatly impressed by the most useful instruction I have received
since I raised my need for help on this subject. The more I read the
more things fall into place. My grateful thanks to one and all and
please keep the good stuff flowing.
Norman
___
> I apologize to the list again for the noisy contentless ranting I made
> yesterday, so I'll try making it up by doing concrete demos of a
> function-focused approach. This will critique Zelle's Chapter Two and
> Chapter Five, and see what things would look like if under a function
> regime.
>
> I want to be able to launch and run python 2.4.1, from the user account so I
> do not need to be "root" every time.
I use Ubuntu Linux and Python 2.4.1 comes with it. All I need to do is
to open a terminal and type python and press enter. What's the problem?
Norman
_
12 matches
Mail list logo