Skip to content

Commit

Permalink
changed concate program
Browse files Browse the repository at this point in the history
  • Loading branch information
linrakesh committed Mar 26, 2019
1 parent 330c40e commit 7ea7ec8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions DataStructure/bubble_sort.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
x =[3,56,2,56,78,56,34,23,4,78,8,123,45]
for i in range(1,13):
for i in range(1,len(x)):
for j in range(0,13-i):
if(x[j]>x[j+1]):
x[j],x[j+1] = x[j+1],x[j]

print("Sorted Array :")
for i in x:
print(i,end =" ")
print(i,end =" ")
12 changes: 6 additions & 6 deletions DataStructure/concate.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
x =[3,56,2,56,78,56,34,23,4,78,8,123,45]
y = [23,2,3,4]
z=[]
for i in x:
z.append(i)
for i in y:
z.append(i)

# z=[]
# for i in x:
# z.append(i)
# for i in y:
# z.append(i)
z= x+y
#display concatenated list
for i in z:
print(i,end=" ")
4 changes: 2 additions & 2 deletions database/delete_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#-------------------------------------------------------------------------------

import MySQLdb
db = MySQLdb.connect("localhost","root","ramji","cable")
db = MySQLdb.connect("localhost","root","","cable")
cursor = db.cursor()
name = input("Enter any name")
name = input("Enter any name : ")
sql ="delete from customer where name like '%" + name + "';"
cursor.execute(sql)
db.commit()
Expand Down
4 changes: 3 additions & 1 deletion database/insert_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# Created: 12-04-2018
# Copyright: (c) acer 2018
# Licence: MIT
#for mysql - pip install mysqlclient
#for prettytable - pip install prettytable
#-------------------------------------------------------------------------------
import MySQLdb
from prettytable import PrettyTable
Expand Down Expand Up @@ -41,7 +43,7 @@ def input_data(cursor):
"""MAIN PROGRAM START FROM HERE """

if __name__=='__main__':
db = MySQLdb.connect("localhost","root","ramji","cable")
db = MySQLdb.connect("localhost","root","","cable")
cursor = db.cursor()
# sql ="insert into customer values(20,'rakesh','jagdish','cf-4 arun vihar','12121212','arun@bin.com');"
# cursor.execute(sql)
Expand Down
2 changes: 1 addition & 1 deletion database/mysql_connection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Database connectivity mysql."""
import MySQLdb
# Open database connection
db = MySQLdb.connect("localhost", "root", "ramji", "cable" )
db = MySQLdb.connect("localhost", "root", "", "cable" )
# prepare a cursor object using cursor() method
cursor = db.cursor()
# execute SQL query using execute() method.
Expand Down
2 changes: 1 addition & 1 deletion database/select_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import MySQLdb
from prettytable import PrettyTable
# Open database connection
db = MySQLdb.connect("localhost","root","ramji","cable" )
db = MySQLdb.connect("localhost","root","","cable" )
cursor = db.cursor()
cnt = cursor.execute("select count(*) from customer")
sql ="select * from customer"
Expand Down

0 comments on commit 7ea7ec8

Please sign in to comment.