Skip to content

Instantly share code, notes, and snippets.

keNzi keNzi

Block or report user

Report or block keNzi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@keNzi
keNzi / find_most_common_number
Last active May 13, 2018
find most common number
View find_most_common_number
numbers = [1, 2, 3, 2, 2, 2, 2, 2, 9, 1]
def find_most_common_number(numbers):
from collections import Counter
return print(Counter(numbers).most_common(1)[0][0])
def find_most_common_number(numbers):
count_list = [[x, numbers.count(x)] for x in set(numbers)]
View simple xmas tree in python
def xmassTree(floors):
for x in [z for z in range(1, floors * 2 + 1, 2)]:
floors -= 1
print(' ' * floors, '*' * x)
xmassTree(5)
def xmasttree(count):
You can’t perform that action at this time.