Skip to content

Instantly share code, notes, and snippets.

Avatar

sangram Sangram92

View GitHub Profile
View python_que1.py
"""Write a program which will find all such numbers
which are divisible by 7 but are not a multiple of 5,
between 2000 and 3200 (both included).
The numbers obtained should be
printed in a comma-separated sequence on a single line.
"""
result = []
for num in range(2000, 3201):
if num % 7 == 0 and num % 5 != 0:
View possible_prime_no.py
"""find the all the possible prime number from the given integer number
input : 3657
output : 3 5 7 37 53 67 73 367 563 653 673
"""
import itertools
final_list = []
num = raw_input("Enter no : ")
for x in range(1,len(num)+1):
View cows_and_bulls.py
from random import randint
def cows_and_bulls():
generated_no = randint(1000,9999)
print generated_no
x = 0
count = 0
while(True):
no = input("Enter 4 digit no : ")
no_list = list(str(no))
print no
View revers_word_order.py
def reverse_word_order(sentence):
words = sentence.split(" ")
reverse_list = words[::-1]
reverse = ''
for i in reverse_list:
reverse = reverse +' '+ ''.join(i)
print reverse
reverse_word_order('My name is Sangram')
View password_generate.py
import random
import string
from random import randint
def simple_password(count):
password = ''.join(random.choice(string.letters) for x in range(count))
return password
def medium_strong_password():
View fibonnaci_series
count = input("How many times ")
fibonnaci = []
first = 0
second = 1
for i in range(count):
result = first + second
fibonnaci.append(result)
first = second
second = result
print fibonnaci