Question: need help with these questions thx 4.5 Problem 4 (1 mark) Problem: Write a function that given a list of numbers, returns the length of

need help with these questions thx

need help with these questions thx 4.5 Problem 4need help with these questions thx 4.5 Problem 4
4.5 Problem 4 (1 mark) Problem: Write a function that given a list of numbers, returns the length of the longest sequence of numbers within that list that forms an arithmetic progression. Your main program should allow the user to enter space-separated numbers as test lists, until a blank line is entered. List: 1 2 3 3 List: 1 3 4 2 List: 3 2 1 0 4 List : 7 1 List: 7 7 2 List: 10 9 8 7 4 3 2 1 4 List:4.6 Problem 5 (1 mark) Problem: Book club members meet regularly for coffee at a round cafe table. Only a few members turn up randomly each time. It is a good thing that they keep records of who comes to each meeting, because one of them has been diagnosed with contagious book fever. It is very likely that if you sit next to someone with book fever, you will catch book fever. The file meetings . txt contains the names of all the attendees at each meeting, in the order they sat around the table. It contains: 1 Chuck Trevor 2 Zack Olive Xander Ephraim 3 Ralph Wendy Ephraim Grace Leslie Phil Kathy 4 Binh Harry Ralph Xander Zack Chuck Uma Suzy Phil Kathy 5 Neville Leslie Kathy 6 Neville Harry* Binh Vince Xander Zack Quisha Olive Phil 7 Yvonne Uma Trevor Fran Olive Phil Kathy 8 Harry Ralph Ephraim Denise Quisha Grace Phil 9 Binh Mandy Xander Ephraim Leslie Olive Fran 10 John Olive Chuck Mandy Poor Harry, at meeting number 6, is marked with an asterisk because we know he was infected with book fever then. Write a program that reports the names and number of club members infected up to each meeting from the first meeting where anyone was infected, like this: python3 trace . py Enter file name: meetings1 . txt 6 Harry Neville Binh 3 7 Harry Neville Binh 3 Harry Neville Binh Ralph Phil 5 9 Harry Neville Binh Ralph Phil Mandy Fran 7 10 Harry Neville Binh Ralph Phil Mandy Fran John Chuck 9 $ The program should work in general for any such file with exactly one name marked with an asterisk. The file meetings2. txt should produce this output. 9 Phil Andrew Kathy 3 10 Phil Andrew Kathy 3 11 Phil Andrew Kathy Ephraim Harry 5 12 Phil Andrew Kathy Ephraim Harry 5 13 Phil Andrew Kathy Ephraim Harry 5 14 Phil Andrew Kathy Ephraim Harry 5 15 Phil Andrew Kathy Ephraim Harry Suzy Leslie 7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Law Questions!