CS50P Final Project

Поделиться
HTML-код
  • Опубликовано: 30 окт 2023
  • Hello, my name is Valentin Arkov, and I am excited to present my final project for CS50P in Python. The title of my project is “Get current weather with OpenWeatherMap API”. This free tool allows us to get current data about the weather for almost any city in the world.
    We only need to enter the name of the city, and my program extracts the coordinates of the city along with the current temperature and weather conditions, such as whether it is raining, snowing, sunny, or cloudy.
    One challenge I encountered was that indicating the city name alone is not sufficient because there are many cities with the same name in different countries.
    To handle this, the OpenWeatherMap API allows us to enter the city and country separated by a comma. This way, I can choose the Cambridge that I am interested in.
    Another feature of my program is the use of command-line arguments. I can get a simple help message, and I am able to choose between Fahrenheit or Celsius units for temperature. In this slide, you can see an example of using Fahrenheit degrees through the command-line arguments (-u F).
    I utilized several tools in this project, including:
    OpenWeatherMap API: to get current weather data
    Requests: to send a prompt and get a response
    JSON: to parse the API response
    Regular expressions library and raw string: to check the user's input and ensure that it contains only letters and spaces
    Country converter: to extract the country code from the API response and convert it into the full name of the country
    Argparse library: to parse the command-line arguments
    Formatting: to format the temperature obtained for printing on the screen with Fahrenheit or Celsius degrees
    I also organized the handling of errors by prompting the user to enter the correct name for the city if they entered it incorrectly or if the city is not found by the OpenWeatherMap. In conclusion, I would like to thank the entire CS50 team for creating this interesting and useful course and making it available to anyone interested in learning Python. Thank you for your attention, and have a great day!
    === CS50.ai on Academic Integrity:
    Question:
    In my video presentation of the final project for CS50P, am I allowed to demonstrate the sorce code of my program? Please note that the academic honesty reference says "when asking for help, you may show your work to others, but you may not view theirs". Another quote is "Not Reasonable: making available solutions to assessments to anyone".
    DDB Answer:
    Yes, you can demonstrate your source code in your final project video. The academic honesty policy you mentioned is primarily concerned with sharing solutions to problem sets, not final projects. However, you should avoid providing a detailed walkthrough of your code that could enable someone else to replicate your project without understanding the underlying concepts. Instead, focus on explaining the logic and design decisions behind your code.
    === Certificate of completion:
    cs50.harvard.edu/certificates...
    ===
  • ПриколыПриколы

Комментарии •