Python Basic Structure

  There are many components in Python which to develop a program. Let's see some of the very common and frequently used building block o...


There are many components in Python which to develop a program. Let's see some of the very common and frequently used building block of the program.


These are the legal combination of symbols or operators which represents a value.


    1) a=15

    2) x=y+z

    3) if b>5: 


These are programing instructions


   1) a=15 

   2) print("Hello World")

   3) a=b+x


Comments are the lines that are ignored during program execution. Comments are mostly used to clarify the source code.# a symbol is used to make the statement comment.


Single line comment

# This line of code is for variable declaration

Inline comment

a=10  # variable a has value 10

Multiline comments

#This is the first-line comment

#The is second line comment


Functions are a set of statements that are defined under a named code section and we can reuse these functions by specifying the function name( function call). The function's definition is started with "def" keyword


  To Define a function SayHello

     def  SayHello():

         print("Hello India")

   To Call the function

        SayHell()   # this is function call

Blocks or suites:

These are a group of statements that are part of another statement or a function. All the statements inside the block or suite are intended at the same level.


To write a block statements for if condition will be 

  if a> 1000:

     print(" value is too large")

     print("This is a if statement block"



Ansible,6,AWS,1,Azure DevOps,1,Containerization with docker,2,DevOps,2,Docker Quiz,1,Docker Swarm,1,DockerCompose,1,ELK,2,git,2,Jira,1,Kubernetes,1,Kubernetes Quiz,5,SAST DAST Security Testing,1,SonarQube,3,Splunk,2,vagrant kubernetes,1,YAML Basics,1,
DevOpsWorld: Python Basic Structure
Python Basic Structure
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content