Diferències
Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.
Ambdós costats versió prèvia Revisió prèvia | |||
info:cursos:pue:python-pcpp1:m4:2.1 [19/01/2024 09:49] – [Lab 1] mate | info:cursos:pue:python-pcpp1:m4:2.1 [19/01/2024 09:59] (actual) – [solution] mate | ||
---|---|---|---|
Línia 75: | Línia 75: | ||
print(answer[: | print(answer[: | ||
</ | </ | ||
+ | |||
+ | == Lab 2 | ||
+ | Take a look at these two screenshots. They present two different use cases of the same program: | ||
+ | {{ : | ||
+ | {{ : | ||
+ | |||
+ | Your task is to write a code which has exactly the same conversation with the user and: | ||
+ | |||
+ | - defines a class named **Vehicle**, | ||
+ | - defines a class able to encode the Vehicle object into an equivalent JSON string; | ||
+ | - defines a class able to decode the JSON string into the newly created Vehicle object. | ||
+ | |||
+ | Of course, some basic data validity checks should be done, too. We're sure you're careful enough to protect your code from reckless users. |