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 / 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 / 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 / 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 / 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 / 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