Created
February 9, 2025 18:16
-
-
Save VadimDogoda/f1904f646986dd59b55fd88d5eac02dd to your computer and use it in GitHub Desktop.
11.01.25 HomeWork
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#HomeWork 1.1 | |
text = input() | |
listText = text.split() | |
numberText = 0 | |
count = 0 | |
for i in listText: | |
numberText += len(i) | |
count += 1 | |
print(numberText) | |
sr = numberText/count | |
print(sr) | |
#HomeWork 1.2 | |
text = input("Ввести текст: ") | |
textList = text.split() | |
slovo = input("Ввести слово яке ви хочете дізнатись кількість у реченні: ") | |
count = 0 | |
for i in textList: | |
if i == slovo: | |
print(i) | |
count += 1 | |
print(count) | |
#HomeWork 1.3 | |
password = range(int(input("Вкажіть довжину паролю: "))) | |
passwordDB = "" | |
for i in password: | |
i = random.randint(0, 9) | |
passwordDB += str(i) | |
print(passwordDB) | |
#HomeWork 1.5 | |
text = input(" : ") | |
countA = 0 | |
countB = 0 | |
countC = 0 | |
for i in text: | |
if i == "a": | |
countA += 1 | |
elif i == "b": | |
countB += 1 | |
elif i == "c": | |
countC += 1 | |
if countA > countB: | |
print("Буква A зустрічаеться найчастіше") | |
elif countB > countC: | |
print("Буква B зустрічаеться найчастіше") | |
elif countC > countA: | |
print("Буква C зустрічаеться найчастіше") | |
print(countA) | |
print(countB) | |
print(countC) | |
#HomeWork 1.5 | |
emeil = input("Введіть emeil адрес: ") | |
if emeil.count("@") == 1 and emeil[0] != "@" and emeil.count(".") > 0: | |
print("Адресс корректний") | |
else: | |
print("Адрес не коректний") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment