Hey
I am pretty new to Python ( about a day old ). I am currently writing a
small script to just cycle through an XML page and retrieve data if it
exists. So for example an extract from the Xml page will have an
element tagged entry like so
I want this data
I can use the following loop to list
Hi there,
I don't have a lot of experience programming and have to be writing Python scripts for ArcGIS 9.X. and would like to know if someone up there is working in this area so that I can be asking for some advises and help.
Tkx
Mat
___
Tutor maillist
Kent, Thanks once again."I wonder if maybe you need to write some code? You talk about *reading* but you haven't mentioned *writing*. You can't learn to program without writing programs - that would be like learning to write a foreign language by reading books in the language - it helps but it won'
Kent, Thanks once again."I wonder if maybe you need to write some code? You talk about *reading* but you haven't mentioned *writing*. You can't learn to program without writing programs - that would be like learning to write a foreign language by reading books in the language - it helps but it won'
On Thursday 18 May 2006 16:19, Chris Delgado wrote:
> import random
>
> heads = 0
> tails = 0
> flips = 0
>
> if flips <= 100:
>
> coin = random.randrange(2)
>
> if coin = 0:
> heads +=
> elif coin = 1:
> tails +=
>
> flips +=1
>
> print "The coin was flipped 100 tim
johnf, Yup, I actually thought that might be my mistake but I forgot to actually try it. So I did and revised the code (which I'll post below) and now get a syntax error after my heads += line..yikes .# A program that simulates flipping a coin 100 times and the reports the number of heads and tails
Chris Delgado wrote:
> johnf,
>
> Yup, I actually thought that might be my mistake but I forgot to
> actually try it. So I did and revised the code (which I'll post below)
> and now get a syntax error after my heads += line..yikes .
>
> # A program that simulates flipping a coin 100 times and the
Bob et al, Ok guys, program is all fixed up and runs well. HEre is the final code. Thanks for the help and its on to the next prog. Thanks for the patience and help!Chris# A program that simulates flipping a coin 100 times and the reports the number of heads and tails that were flipped#import rand
Chris Delgado wrote:
> Bob et al,
>
> Ok guys, program is all fixed up and runs well. HEre is the final
> code. Thanks for the help and its on to the next prog. Thanks for the
> patience and help!
>
> Chris
>
> # A program that simulates flipping a coin 100 times and the reports
> the number of
Bob, Thanks for the input. I was trying to stick to the lessons in the chapter whose problems I was working on and so I knew using a for loop might be a bit better, I decided to stick with the stuff from the chapter. I do like the way you simplified using the random function, very clever. I need to
10 matches
Mail list logo