☁️
Data.
Block or Report
Block or report sungiven
Report abuse
Contact GitHub support about this user’s behavior. Learn more about reporting abuse.
Report abusePinned
-
tuples as records and immutable lists
tuples as records and immutable lists 1#!/usr/bin/env python3
2# tuples as records & immutable lists
34## TUPLES AS RECORDS ##
5 -
genexp init vs listcomp
genexp init vs listcomp 1#!/usr/bin/env python3
23symbols = "$¢£¥€¤"
4output = tuple(ord(symbol) for symbol in symbols)
5print(output)
-
Cartesian product of card ranks & suits
Cartesian product of card ranks & suits 1#!/usr/bin/env python3
23card_ranks = ["A", "K", "Q"]
4card_suits = ["♠", "♥", "♦", "♣"]
5 -
local scope in comps and gen exps
local scope in comps and gen exps 1#!/usr/bin/env python3
23x = "EGG"
4codes = [ord(x) for x in x]
5 -
vector2d.py
vector2d.py 1import math
23class Vector:
4def __init__(self, x=0, y=0):
5self.x = x
-
listcomp list vs filter/map composit...
listcomp list vs filter/map composition 1#!/usr/bin/env python3
23symbols = "fj#@2$¢£¥€¤92f^x"
45over_ascii = [ord(s) for s in symbols if ord(s) > 127]
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.