forked from fenyx-it-academy/Class4-PythonModule-Week2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWeek-2 Homework.py
More file actions
146 lines (69 loc) · 1.63 KB
/
Week-2 Homework.py
File metadata and controls
146 lines (69 loc) · 1.63 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
### 1 #####
# simdiye kadar yapilmis en hantal python kodu olabilir bu. En az 8 saat ugrastim. ilk once for dongusu ile yapayim dedim
#ilk satirda oldugu gibi ama out of range hatasindan kurtulamadim. Sonunda kese cikara sonuca ulastim
list1 = list(range(1,23))
for i in list1:
list1.remove(i+1)
list2 = list1[2],list1[5],list1[8]
list3 = set(list1)- set(list2)
list4 = list(list3)
list5= list4[3],list4[7]
list6 = set(list4)- set(list5)
list7 =list(list6)
list8 = list7[4]
list8_1 = []
list8_1.append(list8)
list9 = set(list7)- set(list8_1)
list10= list(list9)
list10
# In[ ]:
# In[ ]:
##2##
import collections
from collections import deque
list4 = collections.deque([1,2,3,4,5])
#list4.rotate(2)
list4.rotate(-2)
# In[ ]:
# In[ ]:
###3###
#bos bir dict olustururuz
#replace ile bosluklari yer degistirme yontemi ile aliriz
#karakterleri ayristiririz
#karakter listemizde var mi yok mu kontrol edilir
#ekleme yapilir
#ve print ederiz
soz = dict()
tekst = input('noktalama isareti kullanmadan bir cumle giriniz; ')
tekst = tekst.replace(' ','')
for kelime in tekst:
if kelime in soz:
soz[kelime] = soz[kelime]+1
else:
soz[kelime] = 1
for j in soz:
print(j, ":", soz[j], end=' ', sep=' ')
# In[ ]:
### 4 ####
in1 = input().lower().strip()
in2 = input().lower().strip()
k1 = set(in1)
k2 = set(in2)
k3= k1|k2
a= list(k3)
a.sort()
kar=''.join(a)
cc = list(kar)
aa = ''.join(cc[0:2])
bb = ''.join(cc[2:3])
dd = ''.join(cc[3:])
son = [aa,bb,dd]
son
# In[ ]:
# In[ ]:
# In[ ]:
# In[ ]:
# In[ ]: