project_python/3.1_lesson.2.20.py

21 lines
696 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

***Задание 2 Параграф 3.1***
***Малыши начали учить алфавит. Воспитатель попросил их назвать слова, начинающиеся только с букв а, б или в.
Напишите программу, которая проверит, что все введённые слова соответствуют этим правилам.***
if name == "main":
# вариант без списков
num = int(input())
all_good = True
for _ in range(num):
s = input()
if s[0] not in 'абв':
all_good = False
if all_good:
print('YES')
else:
print('NO')