-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2-5.py
More file actions
36 lines (36 loc) · 1.24 KB
/
2-5.py
File metadata and controls
36 lines (36 loc) · 1.24 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
a = int(input("Vvedite celoe chislo: "))
if a == 0:
print("Nulevoe chislo")
elif a > 0 and a % 2 == 0:
print("Polozhitel'noe chetnoe chislo")
elif a < 0 and a % 2 == 0:
print("Otricatel'noe chetnoe chislo")
else:
print("Chislo ne yavlyaetsya chetnim")
#################################################
word = (input("Vvedite slovo: ")).lower()
vowels = "aeiuy"
count_vowels = 0
count_consonants = 0
for i in range(0, len(word)):
if word[i] in vowels:
count_vowels += 1
else:
count_consonants += 1
print(count_vowels)
print(count_consonants)
print(f'a = {"False" if word.count("a") == 0 else word.count("a")}, e = {"False" if word.count("e") == 0 else word.count("e")}, i = {"False" if word.count("i") == 0 else word.count("i")}, o = {"False" if word.count("o") == 0 else word.count("o")}, y = {"False" if word.count("y") == 0 else word.count("y")}, u = {"False" if word.count("u") == 0 else word.count("u")}')
###################################################
x = int(input("vvedite summu investiciy: "))
a = int(input("skolko y Michaela?: "))
b = int(input("skolo u Ivana?: "))
if a >= x and b >= x:
print(2)
elif a >= x:
print("Michael")
elif b >= x:
print("Ivan")
elif a + b >= x:
print(1)
else:
print(0)