GithubHelp home page GithubHelp logo

lorcalhost / python-weee-entry Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 8 KB

Repository meant to host source code of the assignments I was given to enter the WEEE Open team

Home Page: http://weeeopen.polito.it/

License: MIT License

Python 100.00%
weeeopen python3 politecnico-di-torino entry-test

python-weee-entry's Introduction

WEEE Open team entry assignments

N|Solid

First assignment:

Creare uno script in python3 che riceva in input da tastiera due valori interi, li salvi in due variabili chiamate rispettivamente a e b e le stampi a video nel seguente formato: A = valore B = valore Successivamente, scambia i valori delle due variabili senza usare una terza variabile di swap, e ristampa il risultato nello stesso formato.

English:

Create a Python3 script which receives two integer numbers as keyboard input, saves those values in two variables called a and b and prints them on the console in the following format: A = value B = value Subsequently, swap the values of the two variables without the use of a third variable, and prints the result in the same format.


Second assignment:

Creare uno script in python3 che riceva in input da linea di comando una data nel formato GG/MM/AAAA. Lo script deve stampare a video il giorno della settimana corrispondente a quella data e dire quanti giorni di differenza ci sono tra quel giorno e la data in cui viene runnato lo script.

English:

Create a Python3 script that receives as command line argument a date in the DD/MM/YYYY format. The script has to print on the console the day of the week corresponding to that date and has to say how many days are in between the given date and today's date.


Third assignment:

Sia dato in input un file JSON contenente informazioni riguardanti dei dischi gidi. Lo script deve:

  1. Caricare il file in una lista di dizionari
  2. Ordinare la lista per codice ascendente con complessità O(nlog(n)))
  3. Scrivere in un file di testo i codici dei dischi rigidi funzionanti, per riga, ordinati per codice ascendente

English:

Given as input a JSON file containing information about hard disks. The script has to:

  1. Load the file in a dictionary list
  2. Order the list by increasing code with complexity O(nlog(n))
  3. Write in a text file the codes of the working hard disks, by line, ordered in an increasing order

JSON file format example:

[
    {
        "code": "HDD048976",
        "capacity": "120 GB",
        "working": "NO"
    },
    {
        "code": "HDD095709",
        "capacity": "230 GB",
        "working": "YES"
    }
]

python-weee-entry's People

Contributors

lorcalhost avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.