Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

ASSIGNMENT 2

Python

Total: 34 marks

This Python Assignment is creative. We will look for and mark:

1. Good code practices (e.g. comments, variable naming, formatting)

2. Creativity that is taken to implement the answer

3. Using constructs taught in all Python lessons

4. Effective use of coding constructs (correct location, choice makes sense)

Total marks will be awarded for demonstrating concepts fully, there will be partial marks available for attempts.

There is 1 creative coding question for this assignment.

What to submit:

Submit a downloaded version of your code to your instructors in the agreed method. If you use multiple files, make sure to submit all zipped.

Top tips:

● Read all requirements carefully before starting

● Check the mark distributions as provided below

● Session 6 will cover APIs, but you can start working on this project earlier, making sure other requirements are met, figuring out a scenario,  and more.

Question 1

(34 marks)

Create a console app that interacts with an API of your choice, gets some data out of it and does a meaningful transformation. You can pick one of the suggested APIs which are free and beginner-friendly, this will not impact creativity points. Make sure your API is free to use and do not share your private access key.

Remember to come up with a unique creative problem or scenario!

Marks:

1. 5 points for creativity

2. 4 points for commenting, variable naming, and code formatting

3. 25 points for meeting the requirements (coding concepts taught and their use)

You should:

+ Use boolean values and if..else statements to branch logic of your program

+ Use a data structure like a list, dictionary, set or tuple to store values

+ Use a for loop or a while loop to reduce repetition

+ Use functions with returns to make code reusable

+ Use string slicing

+ Use at least two inbuilt functions 

+ Use any free API to get some information as json. In code, explain how your instructor can set up any necessary API keys and briefly how you are using the API

Import an additional module and use it. If it needs to be installed, explain how to do that in the comments, and briefly note what it is for.

Write your final results in a file

Each of the above-mentioned requirements is worth 2-3 points.  The use of API is worth 7 points.

Suggested APIs:

1. 'Open Notify' - http://open-notify.org/ 

2. 'Pokéapi' - https://pokeapi.co/ 

3. ‘Open Trivia Database’  - https://opentdb.com/api_config.php

4. ‘Open Weather - https://openweathermap.org/api 

5. ‘MyAnimeList’ - https://jikan.moe 

6. ‘Star Wars’ -  https://pipedream.com/apps/swapi 

If you cannot come up with a creative idea you can use this scenario, but 5 points out of the total mark are for creativity and you will receive 0 for creativity:

"Create a program that can retrieve multiple Pokémons and save only their names and moves only to a file in a nice, readable format. At first, we want to ask the user what Pokémons to get and have a choice to get a random one. We want to check they have picked Pikachu as one of the Pokémons. The program should guide users to pick the best Pokémons and have nice messages as we run our program."