-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
76 lines (71 loc) · 2.98 KB
/
main.py
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import math
import bt_utils
import turtle
import turtle_utils
if __name__ == '__main__':
# n, fib_list, prime_list = 0, [], []
#
# n = input('Enter a number: ')
# n = int(n)
# fib_list = bt_utils.fibonacci_series(100)
prime_list = bt_utils.prime(100)
print('Prime Numbers: ' + str(len(prime_list)) + ' - ', str(prime_list))
# prime_list = bt_utils.prime(100)
# print('Fibonacci Numbers: ' + str(len(fib_list)) + ' - ', str(fib_list))
# print(str(55) + ' is a Fibonacci Number:' + str(bt_utils.is_fib_number(55)))
# print(bt_utils.fib_prime_matches(100))
# print('Factorial of ' + str(10) + ':' + str(math.factorial(10)))
# print('15th Fibonacci :' + str(bt_utils.fibonacci(15)))
# print(bt_utils.find('Bhasker Thodla', 'h', 2))
# print(bt_utils.reverse('malayalam'))
# print(bt_utils.reverse('malayalam'))
# print (bt_utils.is_palindrome('Able was I ere I saw Elba'))
# print(bt_utils.is_palindrome('Malayalam'))
# search_str = 'bhasker'
# fin = open ('C:/Users/BMURTHY/IdeaProjects/stock_tweets/words.txt')
# print (fin)
# line_count = e_lines = total_word_length = min_length = max_length = line_length = 0
# for line in fin:
# line_length = len (line.strip ())
# total_word_length = total_word_length + line_length
# line_count = line_count + 1
# if line_count <= 1:
# min_length = max_length = line_length
# else:
# if line_length < min_length:
# min_length = line_length
# elif line_length > max_length:
# max_length = line_length
# print ('Average word length = ' + str (int (total_word_length / line_count)))
# print ('Min word length = ' + str (min_length))
# print ('Max word length = ' + str (max_length))
# if len (line.strip ()) > 15:
# print (line)
# word = line.strip()
# line_count += 1
# if bt_utils.uses_all (word, search_str):
# print (word)
# e_lines += 1
# print('% of "e" words: ', e_lines / line_count * 100)
# print('No. of e-words:', e_lines)
# print('Total no. of words:', line_count)
# # price=24.95
# discount=.4
# shipping=3
# cost=60*price * (1 - discount)-3-59*.75
# print(cost)
# bt_utils.repeat_lyrics()
# print (math.sqrt(5) + 1 / 2)
# print(bt_utils.right_justify('This is the time for all good men to come to the aid of the party', 120))
# turtle_utils.square(turtle.Turtle(), 250)
# turtle_utils.polygon(turtle.Turtle(), 100, 5250)
# turtle_utils.circle(turtle.Turtle(), 100)
# turtle_utils.arc(turtle.Turtle(), 50, 180)
# turtle_utils.triangle(turtle.Turtle(), 250)
# print (bt_utils.count ('MaLayaLAm', 'a'))
# def print_lyrics():
# print ("Hey Jude! Don't you be sad! Take a sad song and make it better")
# print ("Remember to get it into your heart! Then you can start to make it better")
# def repeat_lyrics():
# print_lyrics()
# print_lyrics()