Coding for Analytics Assignment A2.1 – Python Graded ActivityInstructionsWe will solve the following exercises: Given a list with names printed w
- Coding for Analytics
Assignment A2.1 – Python Graded ActivityInstructionsWe will solve the following exercises:
- Given a list with names printed with just the first names, check which is the first name you find starting with the character “a."
- Given a list with the ages of different students, check how many of these values are older than 20.
- Create a list with 5 names:
- Add a new name.
- Remove one of the names.
- Print the length of the list.
- Given a tuple with names, check how many names have more than 6 characters.
- Using a loop and the input command, create a set with 5 names. Check how many of the following names are in that set: “Pablo” and “Ana”
- Do not use loops for this second part of the exercise.
- Create a dictionary with 5 people and their emails. Now do this:
- Extract the email for one of these people.
- Add a new person to the dictionary.
- Check if the email [email protected] is in the dictionary.
- Create a function that receives a list with names, a letter, and a number. The function will check the name in that position. If the name includes the letter given, it will return “Well done”. In other case, it will return "None".
- Example:
Function7([“Anne”,”Charles”,”Otto”,”Pablo”,”John”] , “a”, 3) should return “Well done” because the element in the 3rd position (Pablo) includes the character a.
- Create a function that receives a list with numbers and calculates the mean for just the positive ones or None.
- Note: remember to add comments (using the # symbol) in every exercise so that we can check that you have understood the solution given.
Considerations for this assignment
- This is an individual assignment, and as such must be completed on your own.
- For this assignment, you will submit a single .txt file where you will solve each of the following exercises. For each exercise, you should add a comment at the top with the number of the exercise, for example, Exercise 1.
- You should also provide comments that explain how your code works using the # symbol.
- You will be evaluated for each exercise for your ability to meet the requirements and your ability to explain how you solved the problem in comments. You should also look at the attached rubric for detailed instructions on how each exercise will be graded.
RubricRubric for Assignment A2.1CriteriaRatingsPtsThis criterion is linked to a Learning OutcomeExercise 1The solution should use a loop to iterate over the list and a conditional statement to check if the name starts with “a”. The solution should print the first name that meets the condition and break the loop. The solution should also handle the case when there is no name starting with “a” in the list. The solution should have comments explaining the logic. Points will be deducted for syntax errors, incorrect logic, missing comments, or printing more than one name.2.5 ptsFull Points1 ptsPartial Work0 ptsNo Points2.5 ptsThis criterion is linked to a Learning OutcomeExercise 2The solution should use a loop to iterate over the list and a counter variable to keep track of how many values are older than 20. The solution should print the final value of the counter. The solution should have comments explaining the logic. Points will be deducted for syntax errors, incorrect logic, missing comments, or printing intermediate values.2.5 ptsFull Points1 ptsPartial Work0 ptsNo Points2.5 ptsThis criterion is linked to a Learning OutcomeExercise 3The solution should use the append and remove methods to modify the list. The solution should use the len function to print the length of the list. The solution should have comments explaining the logic. Points will be deducted for syntax errors, incorrect logic, missing comments, or using other methods to modify the list.2.5 ptsFull Points1 ptsPartial Work0 ptsNo Points2.5 ptsThis criterion is linked to a Learning OutcomeExercise 4The solution should use a loop to iterate over the tuple and a counter variable to keep track of how many names have more than six characters. The solution should print the final value of the counter. The solution should have comments explaining the logic. Points will be deducted for syntax errors, incorrect logic, missing comments, or printing intermediate values.2.5 ptsFull Points1 ptsPartial Work0 ptsNo Points2.5 ptsThis criterion is linked to a Learning OutcomeExercise 5The solution should use a loop and the input function to create a set with five names. The solution should use the in operator to check if “Pablo” and “Ana” are in the set. The solution should print the result of the check. The solution should have comments explaining the logic. Points will be deducted for syntax errors, incorrect logic, missing comments, or using other methods to create the set or check the membership.2.5 ptsFull Points1 ptsPartial Work0 ptsNo Points2.5 ptsThis criterion is linked to a Learning OutcomeExercise 6The solution should use the get method to extract the email for one of the people. The solution should use the update method to add a new person into the dictionary. The solution should use the in operator to check if the email [email protected] is in the dictionary. The solution should print the results of the operations. The solution should have comments explaining the logic. Points will be deducted for syntax errors, incorrect logic, missing comments, or using other methods to access or modify the dictionary.2.5 ptsFull Points1 ptsPartial Work0 ptsNo Points2.5 ptsThis criterion is linked to a Learning OutcomeExercise 7The solution should define a function that receives a list, a letter, and a number as parameters. The function should use indexing to access the name in the given position. The function should use the in operator to check if the name includes the given letter. The function should return “Well done” if the check is True or None otherwise. The solution should have comments explaining the logic. Points will be deducted for syntax errors, incorrect logic, missing comments, or using other methods to access or check the name.2.5 ptsFull Points1 ptsPartial Work0 ptsNo Points2.5 ptsThis criterion is linked to a Learning OutcomeExercise 8The solution should define a function that receives a list with numbers as a parameter. The function should use a loop to iterate over the list and a conditional statement to filter out the negative numbers. The function should use a counter variable to keep track of how many positive numbers are in the list and a sum variable to keep track of the total of the positive numbers. The function should calculate the mean by dividing the sum by the counter. The function should return the mean or None if the list has no positive numbers. The solution should have comments explaining the logic. Points will be deducted for syntax errors, incorrect logic, missing comments, or using other methods to calculate the mean.2.5 ptsFull Points1 ptsPartial Work0 ptsNo Points2.5 ptsTotal Points: 20
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
