• Complain

BASU - Learn Data Structure Array, Linked List, Stack & Queue using Python in 5 minutes

Here you can read online BASU - Learn Data Structure Array, Linked List, Stack & Queue using Python in 5 minutes full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2021, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    Learn Data Structure Array, Linked List, Stack & Queue using Python in 5 minutes
  • Author:
  • Genre:
  • Year:
    2021
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Learn Data Structure Array, Linked List, Stack & Queue using Python in 5 minutes: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Learn Data Structure Array, Linked List, Stack & Queue using Python in 5 minutes" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

BASU: author's other books


Who wrote Learn Data Structure Array, Linked List, Stack & Queue using Python in 5 minutes? Find out the surname, the name of the author of the book and a list of all author's works by series.

Learn Data Structure Array, Linked List, Stack & Queue using Python in 5 minutes — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Learn Data Structure Array, Linked List, Stack & Queue using Python in 5 minutes" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
LEARN
DATA STRUCTURE
LINKED LIST
ARRAY
STACK
QUEUE
USING
PYTHON
IN 5 MINUTES
Copyright 2021 S Basu
All rights reserved.
Disclaimer:
The information and materials presented here are for educational purposes only. Every effort has been made to make this book as complete and as accurate as possible but no warranty or fitness is implied. The information provided is on an "as is" basis. The ideas and opinions expressed are of the author's own imagination and the author is not affiliated to any organization, school or educational discipline and will not be held accountable or liable for any inadvertent misrepresentation.
Contents
Chapter 1 : Few Important Python Basics
Before we start learning about data structure related topics like linked list, array, stack and queue, we first need to get an understanding about a few python basics like how to create a python module, run a python code and what is a python function or a python class.
So let us first review these python topics.
1.1 : What is a Python module?
  • Python module is a Python file that contains functions, classes, and variables that group a logical functionality together.
  • Modules can be imported for use in code.
Lets create a simple Python file or module,
  • Open Notepad++ and create a new file ( hello_world ) and save the file with .py extension
Inside helloworldpy file write one line of code What is print - photo 1
Inside hello_world.py file, write one line of code:
What is print function in Python print function displays the output to - photo 2
What is print( ) function in Python?
print( ) function displays the output to the screen
Now lets run the above piece of code.
Open command prompt -> Go to the hello_world.py file location and type the following command:
python file_name .py
The output displays Now lets create another Python file and name it testpy - photo 3
The output displays
  • Now lets create another Python file and name it test.py
In testpy file simply import the helloworld module created above Now run - photo 4
In test.py file, simply import the hello_world module created above.
Now run this file Open command prompt -gt Go to the testpy file location - photo 5
Now run this file.
Open command prompt -> Go to the test.py file location and write the following command:
python test .py
We see that the test module prints out Hello World output from helloworld - photo 6
We see that the test module prints out Hello World output from hello_world module.
What is import statement in Python?
import statement in Python allows a Python file or module to access all the codes present in another Python file or module.
1.2 : What is a Python function?
Python Functions are just like Java methods. It is a block of codes performing certain task.
Syntax:
def function_name ( ) :
..
Example:
Code Explanation In the above piece of code we created a function - photo 7
Code Explanation:
  • In the above piece of code, we created a function validate_username with parameter uname. If the argument is John123 , the function prints Hello John or else it will print Wrong username .
  • To call any function, we simply have to write the function name followed by parenthesis . Within that parenthesis, we passed the value of username which is John123
Output
Difference between parameter and argument Parameter is the variable passed to - photo 8
Difference between parameter and argument
Parameter is the variable passed to a function . Example:
function function_name ( variable1 , variable2 ) :
Argument is the value assigned to the variables. Example:
function_name ( 123,Hello_World )
1.3 : What is a Python class?
Python is an object oriented programming language .
A class is a blueprint for creating an object and like any other programming language Python class contains attributes and methods.
Python object contains the copy of all attributes and methods present within its class. To access those properties dot operator ( . ) is used.
  • The syntax for creating a class is:
class class_name :
def __init__(self) :
.
def method1 :
.
The syntax for creating an object of a class is:
class Hello :
def __init__(self) :
h = Hello( ) , where h is the object of class Hello .
What is def __init__ (self)?
"__init__" is a reserved method in Python classes initializing the object s state. In Object Oriented concepts, it refers to the constructor of the class . This method initializes the attributes of a class when an object is created.
self keyword helps to access the attributes of the class.
Example:
Output Important points to note from the above piece of code are A - photo 9
Output
Important points to note from the above piece of code are A Python Class - photo 10
Important points to note from the above piece of code are:
  1. A Python Class name should start with a capital letter.
  1. Within the __init__ method we declared different attributes of our class Employee and passed those values to self . id_num , self . name and so on.
  1. In our validation ( ) method we pass the argument self which helps to access all the attributes of the class Employee .
  1. str( ) function helps to convert an integer value to a string value.
  1. and keyword is the logical and operator in Python.
  1. In line 15 of the above code, we created an object e and passed values into it.
Chapter 2 : Array
An Array is a collection of items or elements all having the same datatypes. An element from an array can only be accessed from its index value. Example: Lets create an array of cars.
cars = [Kia, Toyota, Ford, Tesla]
In order to get the value Ford as output we need to write print cars - photo 11
In order to get the value Ford as output, we need to write print ( cars [ ] )
  • In Python, a List is very similar to an Array . It contains a list of elements separated by commas and its elements are written with square brackets [ . ] .
  • A value from a List can be accessed from its index value and the syntax is.
List_name [ index_num ]
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Learn Data Structure Array, Linked List, Stack & Queue using Python in 5 minutes»

Look at similar books to Learn Data Structure Array, Linked List, Stack & Queue using Python in 5 minutes. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Learn Data Structure Array, Linked List, Stack & Queue using Python in 5 minutes»

Discussion, reviews of the book Learn Data Structure Array, Linked List, Stack & Queue using Python in 5 minutes and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.