by Yogesh | Nov 1, 2017 | Python Tutorial
functions in python Function definition There are some simple rules to define a function in Python. They are as follows: Use the def keyword followed by function name with parentheses () Any argument to the function must be placed within these parentheses () The code...
by Yogesh | Nov 1, 2017 | Python Tutorial
What is Dictionary a built-in data structure available in Python a dictionary is a sequence of key-value, or item, pairs separated by commas. Ex port = {22: “SSH”, 23: “Telnet” , 53: “DNS”, 80: “HTTP” } . In a list,...
by Yogesh | Nov 1, 2017 | Python Tutorial
What is List: a built-in data structure available in Python a list of comma-separated values (items) between square brackets. It can contain heterogeneous values such as integers, floats, strings, tuples, lists, and dictionaries. Python lists are mutable; yes, they...
by Yogesh | Oct 31, 2017 | Python Tutorial
Basics of Python Strings. A Python string is a sequence, which consists of zero or more characters. The string is an immutable data structure, which means they cannot be changed. String Function Len function: In order to find the length of the string. Ex len(string...
by Yogesh | Oct 11, 2017 | Python Tutorial
Source Code import sqlite3 db = sqlite3.connect('ganesha.db') cursor = db.cursor() id1=2 name1 = 'AAA' # cursor.execute('update info3 set name = ? where id = ?',(name1,id1)) cursor.execute('delete from info3 where id = ?',(id1,)) db.commit()...
by Yogesh | Oct 11, 2017 | Python Tutorial
Source Code import sqlite3 db = sqlite3.connect('ganesha.db') cursor = db.cursor() id1 = 2 cursor.execute('select *from info3 where id=?',(id1,)) multiplerecord = cursor.fetchall() # print(singlerecord[1]) for row in multiplerecord: # print(row)...