Skip to content

Commit eabeeba

Browse files
video 39
1 parent b77eaa0 commit eabeeba

File tree

2 files changed

+359
-0
lines changed

2 files changed

+359
-0
lines changed

Python_Video39.ipynb

+316
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,316 @@
1+
{
2+
"nbformat": 4,
3+
"nbformat_minor": 0,
4+
"metadata": {
5+
"colab": {
6+
"name": "Python_Video39.ipynb",
7+
"provenance": []
8+
},
9+
"kernelspec": {
10+
"name": "python3",
11+
"display_name": "Python 3"
12+
},
13+
"language_info": {
14+
"name": "python"
15+
}
16+
},
17+
"cells": [
18+
{
19+
"cell_type": "code",
20+
"source": [
21+
"!pip install parsivar"
22+
],
23+
"metadata": {
24+
"colab": {
25+
"base_uri": "https://localhost:8080/"
26+
},
27+
"id": "46xzirNrg822",
28+
"outputId": "7a1327b0-1b91-45c4-e1a9-97d5d1d309a0"
29+
},
30+
"execution_count": 2,
31+
"outputs": [
32+
{
33+
"output_type": "stream",
34+
"name": "stdout",
35+
"text": [
36+
"Collecting parsivar\n",
37+
" Downloading parsivar-0.2.3.tar.gz (36.2 MB)\n",
38+
"\u001b[K |████████████████████████████████| 36.2 MB 339 kB/s \n",
39+
"\u001b[?25hCollecting nltk==3.4.5\n",
40+
" Downloading nltk-3.4.5.zip (1.5 MB)\n",
41+
"\u001b[K |████████████████████████████████| 1.5 MB 45.8 MB/s \n",
42+
"\u001b[?25hRequirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from nltk==3.4.5->parsivar) (1.15.0)\n",
43+
"Building wheels for collected packages: parsivar, nltk\n",
44+
" Building wheel for parsivar (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
45+
" Created wheel for parsivar: filename=parsivar-0.2.3-py3-none-any.whl size=36492972 sha256=2da83ad22a2503323f3eae613cf2c03e1fcea93d221b7f44701d841a5cbf5394\n",
46+
" Stored in directory: /root/.cache/pip/wheels/ae/67/7a/49cbf08f64d3f76a26eceaf0e481a40e233f05d4356875cbed\n",
47+
" Building wheel for nltk (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
48+
" Created wheel for nltk: filename=nltk-3.4.5-py3-none-any.whl size=1449925 sha256=55c57e42896acda4b96f981f2f8bd1982f6c256a1f1faa2905a755e028ac8266\n",
49+
" Stored in directory: /root/.cache/pip/wheels/48/8b/7f/473521e0c731c6566d631b281f323842bbda9bd819eb9a3ead\n",
50+
"Successfully built parsivar nltk\n",
51+
"Installing collected packages: nltk, parsivar\n",
52+
" Attempting uninstall: nltk\n",
53+
" Found existing installation: nltk 3.2.5\n",
54+
" Uninstalling nltk-3.2.5:\n",
55+
" Successfully uninstalled nltk-3.2.5\n",
56+
"Successfully installed nltk-3.4.5 parsivar-0.2.3\n"
57+
]
58+
}
59+
]
60+
},
61+
{
62+
"cell_type": "code",
63+
"execution_count": 1,
64+
"metadata": {
65+
"id": "FHI4GHiQf9Ri"
66+
},
67+
"outputs": [],
68+
"source": [
69+
"import numpy as np"
70+
]
71+
},
72+
{
73+
"cell_type": "code",
74+
"source": [
75+
"np.power(2,3)"
76+
],
77+
"metadata": {
78+
"colab": {
79+
"base_uri": "https://localhost:8080/"
80+
},
81+
"id": "hxLxU42Dg59U",
82+
"outputId": "f2cda25c-7b5c-4ce7-dcb4-40377815c318"
83+
},
84+
"execution_count": 3,
85+
"outputs": [
86+
{
87+
"output_type": "execute_result",
88+
"data": {
89+
"text/plain": [
90+
"8"
91+
]
92+
},
93+
"metadata": {},
94+
"execution_count": 3
95+
}
96+
]
97+
},
98+
{
99+
"cell_type": "code",
100+
"source": [
101+
"np.power(542,22)"
102+
],
103+
"metadata": {
104+
"colab": {
105+
"base_uri": "https://localhost:8080/"
106+
},
107+
"id": "FiBFc5vYhQp5",
108+
"outputId": "33391b38-85dc-4840-91af-eb6a266d55a7"
109+
},
110+
"execution_count": 4,
111+
"outputs": [
112+
{
113+
"output_type": "execute_result",
114+
"data": {
115+
"text/plain": [
116+
"4414533532945219584"
117+
]
118+
},
119+
"metadata": {},
120+
"execution_count": 4
121+
}
122+
]
123+
},
124+
{
125+
"cell_type": "code",
126+
"source": [
127+
"np.power(-32,3)"
128+
],
129+
"metadata": {
130+
"colab": {
131+
"base_uri": "https://localhost:8080/"
132+
},
133+
"id": "pU7xDHXPhTUq",
134+
"outputId": "6e4d24c9-b805-4a1d-f2f8-e2019742e6b8"
135+
},
136+
"execution_count": 5,
137+
"outputs": [
138+
{
139+
"output_type": "execute_result",
140+
"data": {
141+
"text/plain": [
142+
"-32768"
143+
]
144+
},
145+
"metadata": {},
146+
"execution_count": 5
147+
}
148+
]
149+
},
150+
{
151+
"cell_type": "code",
152+
"source": [
153+
"np.power(0.25,0.1)"
154+
],
155+
"metadata": {
156+
"colab": {
157+
"base_uri": "https://localhost:8080/"
158+
},
159+
"id": "YbuEwnVChfe-",
160+
"outputId": "c54cd051-00b0-4ae0-f041-508ca10be418"
161+
},
162+
"execution_count": 6,
163+
"outputs": [
164+
{
165+
"output_type": "execute_result",
166+
"data": {
167+
"text/plain": [
168+
"0.8705505632961241"
169+
]
170+
},
171+
"metadata": {},
172+
"execution_count": 6
173+
}
174+
]
175+
},
176+
{
177+
"cell_type": "code",
178+
"source": [
179+
"x = int(input(\"adad ra vared konid: \"))\n",
180+
"if x > 0:\n",
181+
" print(np.power(x,2))\n",
182+
"elif x==0:\n",
183+
" print(np.power(x,3))\n",
184+
"else:\n",
185+
" print(np.power(x,4))\n"
186+
],
187+
"metadata": {
188+
"colab": {
189+
"base_uri": "https://localhost:8080/"
190+
},
191+
"id": "pSdk9C3ThjE4",
192+
"outputId": "d2d6deca-5708-402b-8c88-adc493c30ced"
193+
},
194+
"execution_count": 10,
195+
"outputs": [
196+
{
197+
"output_type": "stream",
198+
"name": "stdout",
199+
"text": [
200+
"adad ra vared konid: 0\n",
201+
"0\n"
202+
]
203+
}
204+
]
205+
},
206+
{
207+
"cell_type": "code",
208+
"source": [
209+
"np.power(20,0)"
210+
],
211+
"metadata": {
212+
"colab": {
213+
"base_uri": "https://localhost:8080/"
214+
},
215+
"id": "WMwnxLvQiKlT",
216+
"outputId": "77c24ca2-e181-4665-af6a-b28650703e7a"
217+
},
218+
"execution_count": 11,
219+
"outputs": [
220+
{
221+
"output_type": "execute_result",
222+
"data": {
223+
"text/plain": [
224+
"1"
225+
]
226+
},
227+
"metadata": {},
228+
"execution_count": 11
229+
}
230+
]
231+
},
232+
{
233+
"cell_type": "code",
234+
"source": [
235+
"x = int(input(\"adad ra vared konid: \"))\n",
236+
"while(x>-6):\n",
237+
" print(x)\n",
238+
" x = x-1"
239+
],
240+
"metadata": {
241+
"colab": {
242+
"base_uri": "https://localhost:8080/"
243+
},
244+
"id": "Duo2hrv0inw3",
245+
"outputId": "34753e82-869c-4b7e-ccbb-4694ec166302"
246+
},
247+
"execution_count": 13,
248+
"outputs": [
249+
{
250+
"output_type": "stream",
251+
"name": "stdout",
252+
"text": [
253+
"adad ra vared konid: 10\n",
254+
"10\n",
255+
"9\n",
256+
"8\n",
257+
"7\n",
258+
"6\n",
259+
"5\n",
260+
"4\n",
261+
"3\n",
262+
"2\n",
263+
"1\n",
264+
"0\n",
265+
"-1\n",
266+
"-2\n",
267+
"-3\n",
268+
"-4\n",
269+
"-5\n"
270+
]
271+
}
272+
]
273+
},
274+
{
275+
"cell_type": "code",
276+
"source": [
277+
"x = int(input(\"adad1 ra vared konid: \"))\n",
278+
"y = int(input(\"adad2 ra vared konid: \"))\n",
279+
"if x%2 == 1:\n",
280+
" x = x+1\n",
281+
"for i in range(x,y,2):\n",
282+
" print(i, end=\" \")"
283+
],
284+
"metadata": {
285+
"colab": {
286+
"base_uri": "https://localhost:8080/"
287+
},
288+
"id": "Ray7TqDDi7--",
289+
"outputId": "7366ab27-1c08-4808-be89-4652ff857a83"
290+
},
291+
"execution_count": 18,
292+
"outputs": [
293+
{
294+
"output_type": "stream",
295+
"name": "stdout",
296+
"text": [
297+
"adad1 ra vared konid: 21\n",
298+
"adad2 ra vared konid: 30\n",
299+
"21 23 25 27 29 "
300+
]
301+
}
302+
]
303+
},
304+
{
305+
"cell_type": "code",
306+
"source": [
307+
""
308+
],
309+
"metadata": {
310+
"id": "uAdSeBp4jMWZ"
311+
},
312+
"execution_count": null,
313+
"outputs": []
314+
}
315+
]
316+
}

python_video39.py

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# -*- coding: utf-8 -*-
2+
"""Python_Video39.ipynb
3+
4+
Automatically generated by Colaboratory.
5+
6+
Original file is located at
7+
https://colab.research.google.com/drive/1zNe_u90vN7o-lE7hk5djFeD2GC5q-Mlh
8+
"""
9+
10+
!pip install parsivar
11+
12+
import numpy as np
13+
14+
np.power(2,3)
15+
16+
np.power(542,22)
17+
18+
np.power(-32,3)
19+
20+
np.power(0.25,0.1)
21+
22+
x = int(input("adad ra vared konid: "))
23+
if x > 0:
24+
print(np.power(x,2))
25+
elif x==0:
26+
print(np.power(x,3))
27+
else:
28+
print(np.power(x,4))
29+
30+
np.power(20,0)
31+
32+
x = int(input("adad ra vared konid: "))
33+
while(x>-6):
34+
print(x)
35+
x = x-1
36+
37+
x = int(input("adad1 ra vared konid: "))
38+
y = int(input("adad2 ra vared konid: "))
39+
if x%2 == 1:
40+
x = x+1
41+
for i in range(x,y,2):
42+
print(i, end=" ")
43+

0 commit comments

Comments
 (0)