Skip to content
View sungiven's full-sized avatar
☁️
☁️
Block or Report

Block or report sungiven

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned

  1. tuples as records and immutable lists tuples as records and immutable lists
    1
    #!/usr/bin/env python3
    2
    # tuples as records & immutable lists
    3
    
                  
    4
    ## TUPLES AS RECORDS ##
    5
    
                  
  2. genexp init vs listcomp genexp init vs listcomp
    1
    #!/usr/bin/env python3
    2
    
                  
    3
    symbols = "$¢£¥€¤"
    4
    output = tuple(ord(symbol) for symbol in symbols)
    5
    print(output)
  3. Cartesian product of card ranks & suits Cartesian product of card ranks & suits
    1
    #!/usr/bin/env python3
    2
    
                  
    3
    card_ranks = ["A", "K", "Q"]
    4
    card_suits = ["♠", "♥", "♦", "♣"]
    5
    
                  
  4. local scope in comps and gen exps local scope in comps and gen exps
    1
    #!/usr/bin/env python3
    2
    
                  
    3
    x = "EGG"
    4
    codes = [ord(x) for x in x]
    5
    
                  
  5. vector2d.py vector2d.py
    1
    import math
    2
    
                  
    3
    class Vector:
    4
        def __init__(self, x=0, y=0):
    5
            self.x = x
  6. listcomp list vs filter/map composit... listcomp list vs filter/map composition
    1
    #!/usr/bin/env python3
    2
    
                  
    3
    symbols = "fj#@2$¢£¥€¤92f^x"
    4
    
                  
    5
    over_ascii = [ord(s) for s in symbols if ord(s) > 127]