Python Code Samples



Filters


Ramya
Difference between normal def defined function and lambda function in Python
Ramya | 5 years, 4 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
How to get the master IP Address of EMR Cluster
Reshma | 5 years, 3 months
import os
import boto3
session = boto3.Session(profile_name='aws_profile_name')
python aws ipaddress
gaya38
Shuffle list elements in python
gaya38 | 6 years, 2 months
import random;
z = [1,90,4,2]
z = random.shuffle(z)
python
Use map function in python
kishore_kumar | 6 years, 2 months
def get_double(num):
    return num * 2

python
gaya38
Python sample codes for beginners
gaya38 | 6 years, 2 months
print "Welcome to python"
Basic python programs available in below links which will covers most of the examples of Level 1 pyt
python
gaya38
Python program for prime number check
gaya38 | 6 years, 2 months
a=input("Enter a value:")
k=0
b=(a/2)+1
python
find all numbers in a string using python regular expression
kishore_kumar | 5 years, 3 months
import re

inp_st = "This 1 line has 100 number, 34 and 90s two"
re python string
How to get the list of available files in S3 instead of getting the folders using boto3?
Reshma | 4 years, 11 months
import boto3

client = boto3.client('s3', aws_access_key_id="aws_access_key",
boto3 python list of files in s3
Convert yaml / yml file contents to python dictionary object
kishore_kumar | 5 years, 4 months
import yaml

with open('sample.yaml') as f:
python yaml yml
Django filter and sum query
kishore_kumar | 2 years, 10 months
from django.db.models import Sum

# Model -> Marks
python django django-orm
Prev Next