Skip to content

McKay Bonham: Sprint-Challenge--Intro-Python - #1

Open
MEBonham wants to merge 4 commits into
masterfrom
mckay
Open

MEBonham wants to merge 4 commits into
masterfrom
mckay

Conversation

@MEBonham

Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/oop/oop2.py
def __init__(self):
super().__init__(2)

def drive(self):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Comment thread src/comp/comp.py
print("Starts between C and G, inclusive:")
c = []
letter_range = ["C", "D", "E", "F", "G"]
c = [x.name for x in humans if x.name[0] in letter_range]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. there´s also an ordinal relation between letters in Python, so
'A' < 'B' (is true)
'X' > 'Y' (returns false)
so the code below also works

c = [x.name for x in humans if x.name[0] >= 'C' and x.name[0] <= 'G']

# For each city record, create a new City instance and add it to the
# `cities` list

with open("./cities.csv", newline='') as csvfile:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice!

@LuisanSuarez

Copy link
Copy Markdown

great job McKay, doing good. everything looks clean!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants