tuples:python values that cannot be modified are called immutable, and immutable lists are called tuples.
Such as:
dimensions= (200,50) print (Dimensions[0]) print (dimensions[1])
list: consists of a series of elements arranged in a particular order.
bicycles=[' Trek ', ' Cannondale ', ' Redline ']print (bicycles)
function: a code block with a name that is used to accomplish specific work.
def greet_user (username): print ("Hello," + username.title () + "!")
Pass arguments : positional arguments and keyword arguments
positional arguments: The order of the arguments based on the argument.
keyword Argument : is the name----value pair that is passed to the function. You associate the name and value directly in the argument.
class : Method _init_ () is a special method that Python will run automatically whenever an instance of the class is created.
Class Dog (): def _init_ (self, Name, age): self.name = name Self.age = Age def sit (self): print ( Self.name.title () + "is now sitting.") def roll_over (self): print (Self.name.tilte () + "rolled over!")
Python programming: From introductory to practical reading notes (i)