Skip to content

Instantly share code, notes, and snippets.

View LiVanych's full-sized avatar

Li Vanych LiVanych

  • Lviv, Ukraine
View GitHub Profile
@LiVanych
LiVanych / dec2hex.py
Last active January 5, 2018 11:38
[Decimal to Hex] Convert decimal numbers to hex format. #python #numbers #hex #decimal #convert
#! /usr/bin/env python3
print('%x' % 15)
#f
print('%x' % 16)
#10
print('%x' % 17)
#11
print('%x' % 27)
#1b
@LiVanych
LiVanych / shabang.py
Created December 21, 2017 07:45
[ Shabang ] Python Shabang. #python #python3 #shabang
#! /usr/bin/env python3
@LiVanych
LiVanych / re_find_numbers.py
Last active December 25, 2017 07:47
[Regular Expressions] How it work. #python #module #re
#! /usr/bin/env python3
import re
numberslist = ["818-262-4549","232-232-2323","244-235-9999"]
numbers = re.compile("\d{3}-\d{3}-\d{4}")
for number in numberslist:
log = numbers.search(number)
print(log.group())