-
Notifications
You must be signed in to change notification settings - Fork 0
/
skrypt11.py
73 lines (67 loc) · 1.37 KB
/
skrypt11.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
72
73
import os
import time
from math import pi
print("Witajcie \n")
liczba = 6
liczba1 = 6 * 1.5
print(liczba," ",liczba1)
A = "pythonhonhon"
print(len(A))
print(A[0]," ",A[3])
print(A[-1])
print(A+" warsztaty")
print(A[3:5])
print(A*3)
A = A.replace("hon", "bu")
print(A)
A = A.upper()
print(A)
#--------------------------
L = [3, "warsztaty", 2.13, "python", 42, 512]
print(len(L))
print(L[1])
print(L[1][1])
L = L+[1,2,3]
print(L)
L.append("IKN")
print(L)
L.pop(2)
print(L)
L.reverse()
print(L)
inty = [2,[3,6],[12,67,3],56,9]
print(inty[1][1])
#-------------------------------
B = {"sala": 1018, "temat": "Python", "uniwersytet": "UwB"}
print(B["sala"])
#--------------------------------------------------------
T = (1,2,3,2,5,2)
print(T.count(2))
T = T+(1,2,6,6)
print(T)
#--------------------------------------------------------
f = open('data.txt',"w")
f.write("Witaj, \n")
f.close()
g = open('data.txt',"r")
text = g.read()
print(text)
#----------------------------------------------
#d = input("wpisz liczbe \n")
#print(d)
x = 5
y = 5
if x>y:
print("X wiekszy od Y")
elif x<y:
print("X mniejszy od Y")
else:
print("Nie wiem")
#---------------------------------
for i in range(20,40):
print(i)
S = {'sala': 1018, 'nazwa': "warszaty", 'temat': "python"}
for x in S:
print(x, "->", S[x])
Y = pi
print(Y)