Skip to content

Instantly share code, notes, and snippets.

View PushkraJ99's full-sized avatar
:shipit:
Security Researcher

PushkraJ PushkraJ99

:shipit:
Security Researcher
View GitHub Profile
@PushkraJ99
PushkraJ99 / Palindrome.py
Last active April 28, 2022 03:14
Palindrome.py
# Program to check if a string is palindrome or not
string = input("Input the String:")
# make it suitable for caseless comparison
string = string.casefold()
# reverse the string
rev_str = reversed(string)
# check if the string is equal to its reverse
@PushkraJ99
PushkraJ99 / Fibonacci Sequence.py
Last active June 5, 2022 15:37
Fibonacci Sequence Using Python
#Fibonacci Sequence using Python (Github:-PushkraJ99)
def fib(n):
if (n<=1):
return n
else:
return (fib(n-1)+fib(n-2))
num=int(input("Enter number:"))
for u in range(num):
print(fib(u))
@PushkraJ99
PushkraJ99 / Bubble Sort.py
Last active June 5, 2022 15:36
Bubble Sort Using Python
#Bubble Sort using Python (Github:-PushkraJ99)
def sort (num):
for i in range (len(num)-1,0,-1):
for j in range (i):
if num [j]>num[j+1]:
temp =num[j]
num[j]=num[j+1]
num[j+1]=temp
num=[1,5,8,9,4,7,6]
@PushkraJ99
PushkraJ99 / 1D Array.py
Last active June 5, 2022 15:36
1D Array using Python
#1D Array using Python (Github:-PushkraJ99)
import numpy
n= int(input("Enter Size :"))
arr = numpy.ndarray(shape=(n))
print("Enter %d Elements :" %n)
for i in range (n):
arr[i] = int(input())
@PushkraJ99
PushkraJ99 / Armstrong Number.py
Last active June 5, 2022 15:35
Armstrong Number
#Armstrong Number using Python (Github:-PushkraJ99)
i=int(input("Enter Number to Check : "))
orig=i
sum=0
while(i>0):
sum=sum+(i%10)*(i%10)*(i%10)
i=i//10
if orig==sum:
print("This Number is Armstrong !!")
else:
@PushkraJ99
PushkraJ99 / Palindrome.py
Last active June 5, 2022 15:35
Palindrome 2
#Palindrome using Python (Github:-PushkraJ99)
string=input(("Enter a string:"))
if(string==string[::-1]):
print("The string is a palindrome")
else:
print("The string is Not a palindrome")
@PushkraJ99
PushkraJ99 / Palindrome.py
Last active June 5, 2022 15:34
Palindrome 3
#Palindrome using Python (Github:-PushkraJ99)
num=int(input("Enter a number:"))
temp=num
rev=0
while(num>0):
dig=num%10
rev=rev*10+dig
num=num//10
if(temp==rev):
print("The number is palindrome!")
@PushkraJ99
PushkraJ99 / Linear search using Python.py
Last active June 5, 2022 15:31
Linear search using Python
#Linear search using Python (Github:-PushkraJ99)
pos = -1
def search(list, n):
i = 0
while i< len(list):
if list[i] == n:
globals()['pos'] = i
return True
@PushkraJ99
PushkraJ99 / Password Cracker.py
Last active June 5, 2022 15:30
Password Cracker Made in Python
#Password Cracker (Github:-PushkraJ99)
# importing random
from random import*
# taking input from user
user_pass = input("Enter your password :- ")
# storing alphabet letter to use thm to crack password
password = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j','k',
'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't','u','v',
@PushkraJ99
PushkraJ99 / Tower Of Hanoi.py
Last active June 5, 2022 15:30
Tower Of Hanoi Python
#Tower Of Hanoi (Github:-PushkraJ99)
from tkinter import N
def TOH(numbers, start, aux, end):
if numbers ==1:
print("Move Disk 1 From Rod {} to Rod {} ".format(start,end))
return
TOH(numbers-1,start,end,aux)
print("Move Disk {} From Rod {} to Rod {} ".format(numbers,start,end))