Skip to content

Commit c5ca774

Browse files
assigment tricks
1 parent 0990d2e commit c5ca774

File tree

2 files changed

+454
-0
lines changed

2 files changed

+454
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"number1 = 5"
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": 2,
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"number2 = 8"
19+
]
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": 3,
24+
"metadata": {},
25+
"outputs": [
26+
{
27+
"data": {
28+
"text/plain": [
29+
"5"
30+
]
31+
},
32+
"execution_count": 3,
33+
"metadata": {},
34+
"output_type": "execute_result"
35+
}
36+
],
37+
"source": [
38+
"number1"
39+
]
40+
},
41+
{
42+
"cell_type": "code",
43+
"execution_count": 4,
44+
"metadata": {},
45+
"outputs": [
46+
{
47+
"data": {
48+
"text/plain": [
49+
"8"
50+
]
51+
},
52+
"execution_count": 4,
53+
"metadata": {},
54+
"output_type": "execute_result"
55+
}
56+
],
57+
"source": [
58+
"number2"
59+
]
60+
},
61+
{
62+
"cell_type": "markdown",
63+
"metadata": {},
64+
"source": [
65+
"**Change value**"
66+
]
67+
},
68+
{
69+
"cell_type": "code",
70+
"execution_count": 5,
71+
"metadata": {},
72+
"outputs": [],
73+
"source": [
74+
"number1,number2 = number2,number1"
75+
]
76+
},
77+
{
78+
"cell_type": "code",
79+
"execution_count": 6,
80+
"metadata": {},
81+
"outputs": [
82+
{
83+
"data": {
84+
"text/plain": [
85+
"8"
86+
]
87+
},
88+
"execution_count": 6,
89+
"metadata": {},
90+
"output_type": "execute_result"
91+
}
92+
],
93+
"source": [
94+
"number1"
95+
]
96+
},
97+
{
98+
"cell_type": "code",
99+
"execution_count": 7,
100+
"metadata": {},
101+
"outputs": [
102+
{
103+
"data": {
104+
"text/plain": [
105+
"5"
106+
]
107+
},
108+
"execution_count": 7,
109+
"metadata": {},
110+
"output_type": "execute_result"
111+
}
112+
],
113+
"source": [
114+
"number2"
115+
]
116+
},
117+
{
118+
"cell_type": "markdown",
119+
"metadata": {},
120+
"source": [
121+
"***"
122+
]
123+
},
124+
{
125+
"cell_type": "markdown",
126+
"metadata": {},
127+
"source": [
128+
"**Increase value**"
129+
]
130+
},
131+
{
132+
"cell_type": "code",
133+
"execution_count": 8,
134+
"metadata": {},
135+
"outputs": [],
136+
"source": [
137+
"x = 3"
138+
]
139+
},
140+
{
141+
"cell_type": "code",
142+
"execution_count": 9,
143+
"metadata": {},
144+
"outputs": [],
145+
"source": [
146+
"x +=1"
147+
]
148+
},
149+
{
150+
"cell_type": "code",
151+
"execution_count": 10,
152+
"metadata": {},
153+
"outputs": [
154+
{
155+
"data": {
156+
"text/plain": [
157+
"4"
158+
]
159+
},
160+
"execution_count": 10,
161+
"metadata": {},
162+
"output_type": "execute_result"
163+
}
164+
],
165+
"source": [
166+
"x"
167+
]
168+
},
169+
{
170+
"cell_type": "code",
171+
"execution_count": 11,
172+
"metadata": {},
173+
"outputs": [],
174+
"source": [
175+
"x +=5"
176+
]
177+
},
178+
{
179+
"cell_type": "code",
180+
"execution_count": 12,
181+
"metadata": {},
182+
"outputs": [
183+
{
184+
"data": {
185+
"text/plain": [
186+
"9"
187+
]
188+
},
189+
"execution_count": 12,
190+
"metadata": {},
191+
"output_type": "execute_result"
192+
}
193+
],
194+
"source": [
195+
"x"
196+
]
197+
},
198+
{
199+
"cell_type": "code",
200+
"execution_count": null,
201+
"metadata": {},
202+
"outputs": [],
203+
"source": []
204+
}
205+
],
206+
"metadata": {
207+
"kernelspec": {
208+
"display_name": "Python 3",
209+
"language": "python",
210+
"name": "python3"
211+
},
212+
"language_info": {
213+
"codemirror_mode": {
214+
"name": "ipython",
215+
"version": 3
216+
},
217+
"file_extension": ".py",
218+
"mimetype": "text/x-python",
219+
"name": "python",
220+
"nbconvert_exporter": "python",
221+
"pygments_lexer": "ipython3",
222+
"version": "3.7.3"
223+
}
224+
},
225+
"nbformat": 4,
226+
"nbformat_minor": 4
227+
}

0 commit comments

Comments
 (0)