-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlgorithm.py
More file actions
42 lines (34 loc) · 795 Bytes
/
Algorithm.py
File metadata and controls
42 lines (34 loc) · 795 Bytes
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
# user_input = int(input("enter a number"))
# while user_input != 1:
# if user_input % 2 != 0:
# odd = user_input * 3 + 1
# print(odd)
# break
#
# else:
# odd = user_input / 2
# print(odd)
# break
n = 'tobi' # n = 1221
# n = str(n)
print(n == n[::-1])
name = 'koleajeolayinkaoluwatobi'
print(len(name))
print(name * 3)
char = "spam" + '_' + "spam_"
print(char)
for i in range(11, 0, -1):
print("*" * i)
for i in range(1, 11):
print("*" * i)
for j in range(11, 0, -1):
print("2" * j and "2" * j and "*" * i)
a_str = 'spam'
new_str = a_str[:1] + "l" + a_str[2:]
print((new_str))
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
print("SPEAK...")
audio = r.listen(source)
print(r.recognize_google(audio))