Skip to content

Commit 27f939f

Browse files
committed
Created using Colab
1 parent 388d4a7 commit 27f939f

File tree

1 file changed

+150
-0
lines changed

1 file changed

+150
-0
lines changed

Step_PyProf.ipynb

+150
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
{
2+
"nbformat": 4,
3+
"nbformat_minor": 0,
4+
"metadata": {
5+
"colab": {
6+
"provenance": [],
7+
"authorship_tag": "ABX9TyOnQzgaRKBqIJj3Cyv8YmoC",
8+
"include_colab_link": true
9+
},
10+
"kernelspec": {
11+
"name": "python3",
12+
"display_name": "Python 3"
13+
},
14+
"language_info": {
15+
"name": "python"
16+
}
17+
},
18+
"cells": [
19+
{
20+
"cell_type": "markdown",
21+
"metadata": {
22+
"id": "view-in-github",
23+
"colab_type": "text"
24+
},
25+
"source": [
26+
"<a href=\"https://colab.research.google.com/github/Sinrez/PythonProjects/blob/main/Step_PyProf.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
27+
]
28+
},
29+
{
30+
"cell_type": "code",
31+
"execution_count": 11,
32+
"metadata": {
33+
"colab": {
34+
"base_uri": "https://localhost:8080/"
35+
},
36+
"id": "fk9VYEvi4cbd",
37+
"outputId": "00373d8d-6f03-4d99-a989-8a39fdd5d89a"
38+
},
39+
"outputs": [
40+
{
41+
"output_type": "stream",
42+
"name": "stdout",
43+
"text": [
44+
"{\n",
45+
" \"Angola\" - \"Luanda\",\n",
46+
" \"Australia\" - \"Canberra\",\n",
47+
" \"Canada\" - \"Ottawa\",\n",
48+
" \"Colombia\" - \"Bogota\",\n",
49+
" \"Costa Rica\" - \"San Jose\",\n",
50+
" \"Cuba\" - \"Havana\",\n",
51+
" \"Finland\" - \"Helsinki\",\n",
52+
" \"France\" - \"Paris\",\n",
53+
" \"Gabon\" - \"Libreville\",\n",
54+
" \"Iceland\" - \"Reykjavik\",\n",
55+
" \"India\" - \"New Delhi\",\n",
56+
" \"Kazakhstan\" - \"Nur-Sultan\",\n",
57+
" \"Kenya\" - \"Nairobi\",\n",
58+
" \"Liberia\" - \"Monrovia\",\n",
59+
" \"Mali\" - \"Bamako\",\n",
60+
" \"Monaco\" - \"Monaco\"\n",
61+
"}\n"
62+
]
63+
}
64+
],
65+
"source": [
66+
"import json\n",
67+
"\n",
68+
"countries = {'Monaco': 'Monaco', 'Iceland': 'Reykjavik', 'Kenya': 'Nairobi', 'Kazakhstan': 'Nur-Sultan',\n",
69+
" 'Mali': 'Bamako', 'Colombia': 'Bogota', 'Finland': 'Helsinki', 'Costa Rica': 'San Jose',\n",
70+
" 'Cuba': 'Havana', 'France': 'Paris', 'Gabon': 'Libreville', 'Liberia': 'Monrovia',\n",
71+
" 'Angola': 'Luanda', 'India': 'New Delhi', 'Canada': 'Ottawa', 'Australia': 'Canberra'}\n",
72+
"\n",
73+
"json_data1 = json.dumps(countries, indent=3, separators =(',',' - ' ), sort_keys=True)\n",
74+
"print(json_data1)"
75+
]
76+
},
77+
{
78+
"cell_type": "code",
79+
"source": [
80+
"import json\n",
81+
"\n",
82+
"words = {\n",
83+
" frozenset([\"tap\", \"telephone\"]): (\"tæp\", \"telifəun\"),\n",
84+
" \"travel\": \"trævl\",\n",
85+
" (\"hello\", \"world\"): (\"həˈləʊ\", \"wɜːld\"),\n",
86+
" \"moonlight\": \"muːn.laɪt\",\n",
87+
" \"sunshine\": \"ˈsʌn.ʃaɪn\",\n",
88+
" (\"why\", \"is\", \"so\", \"difficult\"): (\"waɪ\", \"ɪz\", \"səʊ\", \"ˈdɪfɪkəlt\"),\n",
89+
" \"adventure\": \"ədˈventʃər\",\n",
90+
" \"beautiful\": \"ˈbjuːtɪfl\",\n",
91+
" frozenset([\"spoon\", \"block\"]): (\"spu:n\", \"blɔk\"),\n",
92+
" \"bicycle\": \"baisikl\",\n",
93+
" (\"pilot\", \"fly\"): (\"pailət\", \"flai\")\n",
94+
" }\n",
95+
"\n",
96+
"res = {k: w for k, w in words.items() if isinstance(k, (str, int, float, bool)) or k is None}\n",
97+
"#print(res)\n",
98+
"json_data1 = json.dumps(res)\n",
99+
"print(json_data1)"
100+
],
101+
"metadata": {
102+
"colab": {
103+
"base_uri": "https://localhost:8080/"
104+
},
105+
"id": "-SdyHmRfCgf4",
106+
"outputId": "c5ea1541-789a-4d98-b8ec-0db031d9633e"
107+
},
108+
"execution_count": 18,
109+
"outputs": [
110+
{
111+
"output_type": "stream",
112+
"name": "stdout",
113+
"text": [
114+
"{\"travel\": \"tr\\u00e6vl\", \"moonlight\": \"mu\\u02d0n.la\\u026at\", \"sunshine\": \"\\u02c8s\\u028cn.\\u0283a\\u026an\", \"adventure\": \"\\u0259d\\u02c8vent\\u0283\\u0259r\", \"beautiful\": \"\\u02c8bju\\u02d0t\\u026afl\", \"bicycle\": \"baisikl\"}\n"
115+
]
116+
}
117+
]
118+
},
119+
{
120+
"cell_type": "code",
121+
"source": [
122+
"import json\n",
123+
"\n",
124+
"club1 = {\"name\": \"FC Byern Munchen\", \"country\": \"Germany\", \"founded\": 1900,\n",
125+
" \"trainer\": \"Julian Nagelsmann\", \"goalkeeper\": \"M. Neuer\", \"league_position\": 1}\n",
126+
"\n",
127+
"club2 = {\"name\": \"FC Barcelona\", \"country\": \"Spain\", \"founded\": 1899,\n",
128+
" \"trainer\": \"Xavier Creus\", \"goalkeeper\": \"M. Ter Stegen\", \"league_position\": 7}\n",
129+
"\n",
130+
"club3 = {\"name\": \"FC Manchester United\", \"country\": \"England\", \"founded\": 1878,\n",
131+
" \"trainer\": \"Michael Carrick\", \"goalkeeper\": \"D. De Gea\", \"league_position\": 8}\n",
132+
"\n"
133+
],
134+
"metadata": {
135+
"id": "aY-Tau5RHllO"
136+
},
137+
"execution_count": null,
138+
"outputs": []
139+
},
140+
{
141+
"cell_type": "code",
142+
"source": [],
143+
"metadata": {
144+
"id": "X18H30jXHlZW"
145+
},
146+
"execution_count": null,
147+
"outputs": []
148+
}
149+
]
150+
}

0 commit comments

Comments
 (0)