Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Python/calc.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import math
def addition ():
print("Addition")
n = float(input("Enter the number: "))
Expand Down Expand Up @@ -34,6 +35,9 @@ def multiplication ():
print(" Enter 's' for substraction")
print(" Enter 'm' for multiplication")
print(" Enter 'q' for quit")
print(" Enter 'si' for sin function")
print(" Enter 't' for tan function")
print(" Enter 'c' for cos function")
c = input(" ")
if c != 'q':
if c == 'a':
Expand All @@ -48,6 +52,16 @@ def multiplication ():
elif c == 'v':
list = average()
print("Ans = ", list[0], " total inputs ",list[1])
elif c == 'si':
x = int(input("> Enter your number here: "))
print(math.sin(x))
elif c == 'c':
x = int(input("> Enter your number here: "))
print(math.cos(x))
elif c == 't':
x = int(input("> Enter your number here: "))
print(math.tan(x))

else:
print ("Sorry, invilid character")
else:
Expand Down
13 changes: 13 additions & 0 deletions Python/database_connector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import MySQLdb

db = MySQLdb.connect(host= input("> Input the your host adress here: "),
user=input("> Input your username here: "),
passwd=input("> Input your password here"),
db=input("> Input the name of your Database here: "))
print("connection successful")
cur = db.cursor()

cur.execute(input("> Input the file you want to open in your Database"))

for row in cur.fetchall():
print(row[0])