Nivå 10.8 Python oppgavebok
Skriv kode som vil sjekke passordets styrke. Kom med egne kriterier for styrke.
Gitt en liste. Skriv ut i konsollen alle variantene av permutasjoner av elementene i denne listen.
Skriv ut en liste over alle vennlige tall fra et gitt intervall.
Anta at en fil lagrer JSON for byer av følgende type:
{
[
"id": "1",
"city": "city1",
"country": "country1",
],
[
"id": "2",
"city": "city2",
"country": "country1",
],
[
"id": "3",
"city": "city3",
"country": "country2",
]
}
Anta at en fil lagrer JSON for land av følgende type:
{
[
"id": "1",
"country": "country1",
],
[
"id": "2",
"country": "country2",
],
[
"id": "3",
"country": "country3",
]
}
Skriv et skript som i stedet for
land vil erstatte dem med deres id:
{
[
"id": "1",
"city": "city1",
"country_id": "1",
],
[
"id": "2",
"city": "city2",
"country_id": "1",
],
[
"id": "3",
"city": "city3",
"country_id": "2",
]
}