coding shortcuts Flashcards
(3 cards)
1
Q
how to find the hex of a number
A
hex(ord(letter))[2:]
2
Q
how to convert list of tuples to tiples
A
repr(name)[1:-1]
3
Q
how to check for consecutive numbers
A
return all(a[i] - a[i - 1] == 1 for i in range(1, len(a)))