Skip to content

Conversation

@Danushka96
Copy link

New Example Comments added

self.number = 0 #This step creates a new attribute named 'number' and it's value is '0'
def some_function(self): #some_function is a method named 'Some Function'
print "I got called." #when calling to this method it prints 'I got called'
def add_me_up(self, more): #another method with a prameter 'more'.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Spelling error , it should be "parameter".

# SAMPLE CODE TO UNDERSTAND THE CONCEPT OF DICTIONARIES IN PYTHON

cities = {'CA': 'San Francisco', 'MI': 'Detroit','FL': 'Jacksonville'}
#The pythond Dictionaries have two things,
Copy link
Collaborator

Choose a reason for hiding this comment

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

It should be "python" and not "pythond".


cities = {'CA': 'San Francisco', 'MI': 'Detroit','FL': 'Jacksonville'}
#The pythond Dictionaries have two things,
#1st one is the key and secon one is the value
Copy link
Collaborator

Choose a reason for hiding this comment

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

Avoid using short forms (like "secon" etc)

cities = {'CA': 'San Francisco', 'MI': 'Detroit','FL': 'Jacksonville'}
#The pythond Dictionaries have two things,
#1st one is the key and secon one is the value
#The function of the dictionary is when calling the key in dic. it returns the value in the key
Copy link
Collaborator

Choose a reason for hiding this comment

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

Frame the sentences properly without using short forms.

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