-
Notifications
You must be signed in to change notification settings - Fork 1
/
abcsum.py
46 lines (28 loc) · 1.06 KB
/
abcsum.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
class strtools:
def __init__(self,word):
self.sayac = {"harf": 0,
"sayı": 0,
"büyük": 0,
"küçük": 0}
self.word=word
def harfsayibul(self):
for i in self.word:
if i.isnumeric() == True:
self.sayac["sayı"] += 1
elif i.isalpha() == True:
self.sayac["harf"] += 1
else:
pass
print("{} string ifadesinde".format(self.word))
print("{} adet harf var".format(self.sayac["harf"]))
print("{} adet sayı var".format(self.sayac["sayı"]))
def bigorsmall(self):
for i in self.word:
if i.islower() == True:
self.sayac["küçük"] += 1
elif i.isupper() == True:
self.sayac["büyük"] += 1
else:
pass
print("{} adet büyük harf var".format(self.sayac["büyük"]))
print("{} adet küçük harf var".format(self.sayac["küçük"]))