Skip to content

Instantly share code, notes, and snippets.

View ProProgrammer's full-sized avatar

Deep Sukhwani ProProgrammer

View GitHub Profile
"""def digit_sum(n):
nlist = []
count = 0
for n in str(n):
nlist.append(n)
for i in nlist:
count += int(i)
return count"""
def right_most_digit(n):
@ProProgrammer
ProProgrammer / Factorial (Python)
Created September 25, 2013 14:15
The factorial of a non-negative integer x is equal to the product of all integers less than or equal to x and greater than zero.
def factorial(x):
count = 1
for i in range(x):
if x > 1:
count *= x
x -= 1
return count
@ProProgrammer
ProProgrammer / Prime number Test (Python)
Created September 25, 2013 14:23
This function called takes a number as input and returns the boolean True if its is a prime number and False otherwise.
def is_prime(x):
if x < 2:
return False
for s in range(2,x):
if x % s == 0:
return False
else:
return True
def reverse(text):
lenofString = len(text)
string1 = ""
for i in range(0, lenofString):
string1 += text[lenofString-1:lenofString]
lenofString -= 1
return string1
def reverse(text):
reverse = ""
@ProProgrammer
ProProgrammer / Anti Vowel (Python).py
Last active December 23, 2015 22:00
Check for Vowels and remove them from input string
def anti_vowel(text):
for char in 'aeiouAEIOU':
text = text.replace(char,'')
return text
@ProProgrammer
ProProgrammer / Replace characters with asterisks (Censor).py
Last active December 23, 2015 22:09
This function called censor that takes two strings, text and word, as input and returns the text with the word you chose replaced with asterisks.
def match_characters(word1, word):
for i in word1.lower():
for j in word.lower():
if i == j:
return True
else:
return False
def censor(text, word):
textlist = text.split()
@ProProgrammer
ProProgrammer / Median of a list of integers.py
Last active December 23, 2015 22:29
The median is the middle number in a sorted sequence of numbers.Finding the median of [7,12,3,1,6] would first consist of sorting the sequence into [1,3,6,7,12] and then locating the middle value, which would be 6.If you are given a sequence with an even number of elements, you must average the two elements surrounding the middle.For example, th…
#Checks if the length of the list is even
def len_even(y):
if len(y) % 2 == 0:
return True
else:
return False
def median(x):
y = sorted(x)
if not len_even(y):
@ProProgrammer
ProProgrammer / My-CV---made-using-HTML-and-CSS.markdown
Last active July 23, 2023 15:37
My CV - Made using HTML / CSS knowledge acquired at Codecademy.com

My CV - made using HTML and CSS

This is my first implementation. I learnt CSS on 15 Jun 2013 at Codecademy.com and as a final project titled "Build your resume!" I took it seriously and decided to go on creating my own Resume using my CSS / HTML knowledge so far (whatever gained from Codecademy.com)

A Pen by Deep Sukhwani on CodePen.

License.

@ProProgrammer
ProProgrammer / gist:6946056
Last active December 25, 2015 08:19
Google Chrome Crash Report - Sent to Apple - 12 Oct 2013 / 10:37
Process: Google Chrome [92237]
Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Identifier: com.google.Chrome
Version: 30.0.1599.69 (1599.69)
Code Type: X86 (Native)
Parent Process: launchd [242]
User ID: 501
Date/Time: 2013-10-12 10:37:39.954 +0530
OS Version: Mac OS X 10.8.5 (12F45)
@ProProgrammer
ProProgrammer / Challenge.py
Last active December 25, 2015 14:58
Formulating Regular Expressions 1 (Challenge and their solutions) - Sharing amazing learnings from Udacity's CS262 - Programming Languages - https://www.udacity.com/course/cs262.Strict Advise: Do Attempt Challenge before you see solution
# RE Challenges
# Assign to the variable regexp a Python regular expression that matches single-
# argument mathematical functions.
# The function name is a lowercase word (a-z), the function argument must be a
# number (0-9), and there may optionally be spaces before and/or after the
# argument.
# Hint: You may need to escape the ( and ).