-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
x = input('Enter any number ') | ||
sum = 0 | ||
for i in x: | ||
y = int(i) | ||
a = y**3 | ||
sum = sum+a | ||
|
||
i = i+1 | ||
print(sum) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import MySQLdb | ||
db = MySQLdb.connect('localhost', 'root', '', 'davschool') | ||
cursor = db.cursor() | ||
cursor.execute('delete from games where id=6') | ||
db.close() | ||
print('record deleted') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import MySQLdb | ||
db = MySQLdb.connect('localhost', 'root', '', 'davschool') | ||
cursor = db.cursor() | ||
cursor.execute('insert into games values (6,"Python fun")') | ||
db.close() | ||
print('Record added successfully') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import MySQLdb | ||
db = MySQLdb.connect('localhost', 'root', '', 'davschool') | ||
cursor = db.cursor() | ||
cursor.execute('select id,gname from games') | ||
game_name = cursor.fetchall() | ||
print('Your Game is :', game_name) | ||
print('Game Id :', game_name[0]) | ||
print('Game name :', game_name[1]) | ||
db.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import MySQLdb | ||
db = MySQLdb.connect('localhost', 'root', '', 'davschool') | ||
cursor = db.cursor() | ||
cursor.execute('select gname from games where id=6') | ||
game_name = cursor.fetchone() | ||
print('Your Game is :', game_name) | ||
db.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import MySQLdb | ||
db = MySQLdb.connect('localhost', 'root', '', 'davschool') | ||
cursor = db.cursor() | ||
cursor.execute('select id,gname from games where id=6') | ||
game_name = cursor.fetchone() | ||
print('Your Game is :', game_name) | ||
print('Game Id :', game_name[0]) | ||
print('Game name :', game_name[1]) | ||
db.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import MySQLdb | ||
db = MySQLdb.connect('localhost', 'root', '', 'davschool') | ||
cursor = db.cursor() | ||
cursor.execute('select id,gname from games where id=6') | ||
game_name = cursor.fetchone() | ||
print('Your Game is :', game_name) | ||
print('Game Id :', game_name[0]) | ||
print('Game name :', game_name[1]) | ||
db.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import MySQLdb | ||
db = MySQLdb.connect('localhost', 'root', '', 'davschool') | ||
cursor = db.cursor() | ||
cursor.execute('update games set gname ="fun with python " where id=6') | ||
db.close() | ||
print('Record updated successfully') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import MySQLdb | ||
db = MySQLdb.connect('localhost', 'root', '', 'davschool') | ||
cursor = db.cursor() | ||
cursor.execute('insert into games values (6,"Python fun")') | ||
db.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import MySQLdb | ||
db = MySQLdb.connect('localhost', 'root', 'ramji', 'davschool') | ||
cursor = db.cursor() | ||
cursor.execute('insert into games values(7,"cricket-new",750 )') | ||
db.close() |