Added task 3

This commit is contained in:
2024-12-21 23:50:13 +02:00
parent 94318de22d
commit 82ac1fcf4d
7 changed files with 133 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
def countAlphaBet(txt: str) -> int:
count = 0
for char in txt:
if char.isalpha(): # בודק אם התו הוא אות
count += 1
return count
def main_1ex():
txt1 = "Hello World!"
print(f'in {txt1} there are {countAlphaBet(txt1)} alphabetic characters')
txt2 = "123 test 123 test"
print(f'in {txt2} there are {countAlphaBet(txt2)} alphabetic characters')
main_1ex()