-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython2
More file actions
66 lines (56 loc) · 1.15 KB
/
python2
File metadata and controls
66 lines (56 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#''' '''
7)Docstring
def say_hello(name):
"""
this function print out Hello, AzatAI
:param name : string, the name of the user to greet.
:return : string, The greetings from AzatAI
"""
return "Hello, {}, Salem from AzatAI".format(name)
print(say_hello('Darganius'))
8)Module
.py дегендердин бари
Питонда осындай внутренний модульдер бар
import os
import subprocess
import sys
import math
#1-zholy
import math
print(math.pi)
#2-zholy
from math import pi
print(pi)
import sys
print(sys.path)# питондағы орнатылған библиотекалар бар екенин корсетеді
path - библиотекалар орны
# time
import time
print(time.time()/3600/24/365)
##import time
##print(time.time())
import time
start_time=time.time()
for i in range(10000):
i+=1
end_time=time.time()
delta=end_time-start_time
print(delta)
3)#thrip
a=1
b=2
c=3
d=a if a>b else c
print(d)
4)loop
print('first')
count=0
while True:
print('count:',count)
count+=1
if(count==10):
break
print('second:')
count=0
for count in range(0,10,2):
print(count)