[Tutor] Python problem

Alan Gauld alan.gauld at yahoo.co.uk
Mon Oct 10 03:58:24 EDT 2022


On 10/10/2022 00:42, Moore, Colleen wrote:
> Hi, I figured I could post a question here that I wasn't sure how to solve. 

That's fine, but although you have posted your assignment you haven't
asked us a question. What is it you want to know? What is it that
puzzles you about the assignment? Have you made a start? What code do
you have? Do you get error messages? If so include them in your post.

[ Although I do note that your assignment is labeled as 3 questions
when it is, in fact, 3 exercises. Personally I would worry about a
course where the course tutors are so illiterate as to not understand
the difference. Or worse, don't care!]

> Below are the problems:
> 
> Question 2. Write a Python program to create a list of 1000 random points. These points must be objects of the Point class. The X and Y coordinates of these points must be random float between a range and any arbitrary range will be fine. (Hint: random.uniform can be used to generate a random floating point value between any two given numbers.)
> 
> Question 3. After you finish the above, write a program to print out the number of points that fall in the left half of the area. If a point is exactly on the middle of the area, you are free to decide to either count it in the left half, or right half. Please note in your program how which is the case.
> 
> Question 4. Write a Python program to draw the points for the above question. Points counted as falling into the left are rendered in darkgrey and right in lightgrey. Submit both your code and a screenshot of the plotting result.
> 
> Thanks!
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
> 

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos






More information about the Tutor mailing list