diff --git a/Python/calc.py b/Python/calc.py index b50d702..ca310f3 100644 --- a/Python/calc.py +++ b/Python/calc.py @@ -1,3 +1,4 @@ +import math def addition (): print("Addition") n = float(input("Enter the number: ")) @@ -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': @@ -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: diff --git a/Python/database_connector.py b/Python/database_connector.py new file mode 100644 index 0000000..f47bab4 --- /dev/null +++ b/Python/database_connector.py @@ -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]) \ No newline at end of file