Docsity

Python Programming Language: A Comprehensive Guide for Beginners, Summaries of Computer science

Partial preview of the text

Download Python Programming Language: A Comprehensive Guide for Beginners and more Summaries Computer science in PDF only on Docsity!

Python

Programming

Language

2

definition

Python was created by Dutch programmer

Guido van Rossum and was first released in

1990. Python is a computer programming

language often used to build websites and

software, automate tasks, and conduct data

analysis. Python Programming language is

used by Google, Instagram, Spotify, Uber,

Netflix,…

2

Looking inside lists: colors=  (^) To print the complet list: print (colors).  (^) To print the first element of the list: print (colors).  (^) To print elements starting from second element to fifth element: print(colors).  (^) To print elements starting from third element: print(colors).  (^) The last member of a list can also be accessed by using the indes -1: print(colors)

5 List built-in functions o (^) The len ( ) function takes a list as a parameter and tell us the number of elements in the list:Print(len(list name)) o (^) Max( ) returns the item in the item in the list with the maximum value:Print(max(list name)) o (^) Min( ) returns the minimum value: print(min(list name)). o (^) List.append( ) appends (add) the element to the end of the list: list name.append(12)/ Print(list name). o (^) List.remove( ) deletes the element of the list: list name.remove(5)/ Print(list name). o (^) List.reverse( ) reverses the objects of the list: list name.reverse( )/Print(list name) o (^) List.sort( ) to arrange the values in ascending order: list name.sort( )/Print(list name) 5