Skip to content

Instantly share code, notes, and snippets.

View tusharhero's full-sized avatar
🚩
away for a while

tusharhero

🚩
away for a while
View GitHub Profile
@tusharhero
tusharhero / prime.py
Last active August 4, 2022 15:32
prime numbers generator
#A python script to generate prime numbers
def getfactors(n):
factors = []
for num in range(1,n+1):
if n%num == 0:
factors.append(num)
return factors
@tusharhero
tusharhero / sum of all odd numbers between 1 to n.py
Last active March 12, 2022 12:11
finds sum of all odd numbers between 1 to n
#! /bin/python3
'''
WRITTEN by Tushar Maharana
LICENSE: https://tusharhero.mit-license.org/
Python program to find sum of all odd numbers between 1 to n.
'''
def is_it_odd(n):#checks if the input is odd
@tusharhero
tusharhero / sorted.py
Created March 8, 2022 02:52
this script will sort any number list from smallest to largest. Uses 2 functions. Only for ascending order. and only integers
'''
WRITTEN by Tushar Maharana
LICENSE: https://tusharhero.mit-license.org/
this script will sort any number list from smallest to largest
'''
def sortedone(list):#function to sort a list.
l = 0#counter
ll = 0# counter
@tusharhero
tusharhero / txt2code.py
Last active March 6, 2022 13:36
Will take text and convert it into code (replace the letters). Uses 3 different functions. (ceaser cipher)
'''
WRITTEN by Tushar Maharana
LICENSE: https://tusharhero.mit-license.org/
“Code” Generator
Will take text and convert it into code (replace the letters)
'''
def c2l(s,dic):#this function will figure out the placement in dictionary
l = 0#variable will contain the placment in dictionary
while l < len(dic): #will break if l is more than the length of dictionary
@tusharhero
tusharhero / ispasswd.py
Last active April 14, 2022 06:09
A script to check if the password is secure. Contains 4 separate functions. Only checks for lower case upper case and numbers but u can also add symbols very easily.
#! /bin/python3
'''
WRITTEN BY TUSHAR MAHARANA @tusharhero.github.io
Took 4 days pls do link me if you use this(highly unlikely)
have fun!
'''
'''
LICENSE: https://tusharhero.mit-license.org/
@tusharhero
tusharhero / video-jugaad.py
Created February 2, 2022 03:26
A script to use termux-api to record videos
import os
a = 0
dir = input('dir: ')
l = 10
C=str(input('camera: ')or"0")
while a < l:
a = 1 + a
c = 'termux-camera-photo -c '+ C+" " + dir + str(a) + '.jpeg'
print(c)