Python Code Samples



Filters


How to connect to PostgreSQL database and display list of tables in python
kishore_kumar | 5 years, 2 months
import psycopg2

conn = psycopg2.connect(host="localhost", database="mydb", user="kishore", passwo
python psycopg2 postgresql
Ramya
Difference between normal def defined function and lambda function in Python
Ramya | 4 years, 9 months
li = [4,65,65,23,86,343,75,3,7,5,87,34,56,64,90] 
final_list = list(filter(lambda x: (x%2 == 0) , l
lambda python
Use map function in python
kishore_kumar | 5 years, 8 months
def get_double(num):
    return num * 2

python
gaya38
Python sample codes for beginners
gaya38 | 5 years, 8 months
print "Welcome to python"
Basic python programs available in below links which will covers most of the examples of Level 1 pyt
python
How to get the master IP Address of EMR Cluster
Reshma | 4 years, 9 months
import os
import boto3
session = boto3.Session(profile_name='aws_profile_name')
python aws ipaddress
gaya38
Python program for prime number check
gaya38 | 5 years, 8 months
a=input("Enter a value:")
k=0
b=(a/2)+1
python
Ramya
Removing IAM Users from IAM group
Ramya | 5 years
def remove_user():
    import boto3
    client = boto3.client('iam')
boto3 aws python
gaya38
Pass command line arguments in python
gaya38 | 5 years, 8 months
import sys
x=len(sys.argv)
a=[]
python
gaya38
Python program for even number checking
gaya38 | 5 years, 8 months
a=input("Enter a value:")
if (a%2==0):
    print "The given number is even number"
python
gaya38
generate fibonacci series in python
gaya38 | 5 years, 8 months
n=input("Enter the constraint to print no of fibanocci values:")
m=input("Enter the maximum value t
python
Prev Next