-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstdlib.py
71 lines (71 loc) · 1.39 KB
/
stdlib.py
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
67
68
69
70
71
#N STANDARD LIBRARY
import sys
def Mutlak(x):
if x<0:
return x*-1
elif x>=0:
return x
def Semua(iterable):
return all(iterable)
def Segala(iterable):
return any(iterable)
def Biner(x):
return bin(x)
def Kebenaran(x):
return bool(x)
def Karakter(i):
return chr(i)
def Perbandingan(x,y):
return cmp(x,y)
def BilDesimal(x):
return float(x)
def Bantuan(objects):
return help(objects)
def BilHeksadesimal(x):
return hex(x)
def Identitas(objects):
return id(objects)
def BilBulat(x):
return int(x)
def Panjang(s):
count=0
for i in s:
count+=1
return count
def BilOktadesimal(x):
return oct(x)
def Ordinari(c):
return ord(c)
def Jangkauan(stop):
i=0
nList=[]
while i<stop:
nList.append(i)
i+=1
return nList
def Jangkauan(start,stop,step=1):
i=start
nList=[]
while i<stop:
nList.append(i)
i+=step
return nList
"""
def Jangkauan(start,stop,step):
return range(start,stop,step)
"""
def Sajak(objects):
return str(objects)
def Tulis(objects,akhir='\n'):
sys.stdout.write(str(objects)+str(akhir))
"""
def Input(x):
return raw_input(x)
"""
def Baca(x=''):
sys.stdout.write(str(x))
In=sys.stdin.readline()
In2=''
for i in range(len(In)-1):
In2+=In[i]
return In2