Skip to content

Commit a728ded

Browse files
committed
commit
1 parent 0d1a0d5 commit a728ded

File tree

1 file changed

+273
-0
lines changed

1 file changed

+273
-0
lines changed

Basics/basics1.ipynb

Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,273 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 3,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"a=10"
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": 4,
15+
"metadata": {},
16+
"outputs": [
17+
{
18+
"data": {
19+
"text/plain": [
20+
"int"
21+
]
22+
},
23+
"execution_count": 4,
24+
"metadata": {},
25+
"output_type": "execute_result"
26+
}
27+
],
28+
"source": [
29+
"type(a)"
30+
]
31+
},
32+
{
33+
"cell_type": "code",
34+
"execution_count": 5,
35+
"metadata": {},
36+
"outputs": [
37+
{
38+
"name": "stdout",
39+
"output_type": "stream",
40+
"text": [
41+
"<class 'int'>\n"
42+
]
43+
}
44+
],
45+
"source": [
46+
"print(type(a))"
47+
]
48+
},
49+
{
50+
"cell_type": "code",
51+
"execution_count": 6,
52+
"metadata": {},
53+
"outputs": [],
54+
"source": [
55+
"b=20"
56+
]
57+
},
58+
{
59+
"cell_type": "code",
60+
"execution_count": 7,
61+
"metadata": {},
62+
"outputs": [],
63+
"source": [
64+
"c=a+b"
65+
]
66+
},
67+
{
68+
"cell_type": "code",
69+
"execution_count": 8,
70+
"metadata": {},
71+
"outputs": [
72+
{
73+
"data": {
74+
"text/plain": [
75+
"30"
76+
]
77+
},
78+
"execution_count": 8,
79+
"metadata": {},
80+
"output_type": "execute_result"
81+
}
82+
],
83+
"source": [
84+
"c"
85+
]
86+
},
87+
{
88+
"cell_type": "code",
89+
"execution_count": 9,
90+
"metadata": {},
91+
"outputs": [
92+
{
93+
"name": "stdout",
94+
"output_type": "stream",
95+
"text": [
96+
"30\n"
97+
]
98+
}
99+
],
100+
"source": [
101+
"print(c)"
102+
]
103+
},
104+
{
105+
"cell_type": "code",
106+
"execution_count": 10,
107+
"metadata": {},
108+
"outputs": [
109+
{
110+
"name": "stdout",
111+
"output_type": "stream",
112+
"text": [
113+
"<class 'int'>\n"
114+
]
115+
}
116+
],
117+
"source": [
118+
"print(type(c))"
119+
]
120+
},
121+
{
122+
"cell_type": "code",
123+
"execution_count": 11,
124+
"metadata": {},
125+
"outputs": [],
126+
"source": [
127+
"list=[1,2,3,4,5,6,7,8,9,10]"
128+
]
129+
},
130+
{
131+
"cell_type": "code",
132+
"execution_count": 12,
133+
"metadata": {},
134+
"outputs": [
135+
{
136+
"data": {
137+
"text/plain": [
138+
"True"
139+
]
140+
},
141+
"execution_count": 12,
142+
"metadata": {},
143+
"output_type": "execute_result"
144+
}
145+
],
146+
"source": [
147+
"a in list"
148+
]
149+
},
150+
{
151+
"cell_type": "code",
152+
"execution_count": 15,
153+
"metadata": {},
154+
"outputs": [
155+
{
156+
"data": {
157+
"text/plain": [
158+
"False"
159+
]
160+
},
161+
"execution_count": 15,
162+
"metadata": {},
163+
"output_type": "execute_result"
164+
}
165+
],
166+
"source": [
167+
"b in list"
168+
]
169+
},
170+
{
171+
"cell_type": "code",
172+
"execution_count": 16,
173+
"metadata": {},
174+
"outputs": [
175+
{
176+
"name": "stdout",
177+
"output_type": "stream",
178+
"text": [
179+
"30\n"
180+
]
181+
}
182+
],
183+
"source": [
184+
"print(c)"
185+
]
186+
},
187+
{
188+
"cell_type": "code",
189+
"execution_count": 18,
190+
"metadata": {},
191+
"outputs": [
192+
{
193+
"name": "stdout",
194+
"output_type": "stream",
195+
"text": [
196+
"10+20=30\n"
197+
]
198+
}
199+
],
200+
"source": [
201+
"print('{}+{}={}'.format(a,b,c))"
202+
]
203+
},
204+
{
205+
"cell_type": "code",
206+
"execution_count": 21,
207+
"metadata": {},
208+
"outputs": [
209+
{
210+
"name": "stdout",
211+
"output_type": "stream",
212+
"text": [
213+
"10+20=30\n"
214+
]
215+
}
216+
],
217+
"source": [
218+
"print(f'{a}+{b}={c}')"
219+
]
220+
},
221+
{
222+
"cell_type": "code",
223+
"execution_count": 22,
224+
"metadata": {},
225+
"outputs": [
226+
{
227+
"name": "stdout",
228+
"output_type": "stream",
229+
"text": [
230+
"10+20=30.0\n"
231+
]
232+
}
233+
],
234+
"source": [
235+
"print(f'{a}+{b}={c:.1f}')"
236+
]
237+
},
238+
{
239+
"cell_type": "code",
240+
"execution_count": null,
241+
"metadata": {},
242+
"outputs": [],
243+
"source": []
244+
}
245+
],
246+
"metadata": {
247+
"kernelspec": {
248+
"display_name": "Python 3.10.7 64-bit",
249+
"language": "python",
250+
"name": "python3"
251+
},
252+
"language_info": {
253+
"codemirror_mode": {
254+
"name": "ipython",
255+
"version": 3
256+
},
257+
"file_extension": ".py",
258+
"mimetype": "text/x-python",
259+
"name": "python",
260+
"nbconvert_exporter": "python",
261+
"pygments_lexer": "ipython3",
262+
"version": "3.10.7"
263+
},
264+
"orig_nbformat": 4,
265+
"vscode": {
266+
"interpreter": {
267+
"hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
268+
}
269+
}
270+
},
271+
"nbformat": 4,
272+
"nbformat_minor": 2
273+
}

0 commit comments

Comments
 (0)