UNDERSTANDING PYTHON CODE STRUCTURE

Code Structure

This is the arrangement of code in a programming language. it encompasses the use of formatting techniques like whitespace and indentation. The goal of a good structure is reliability and maintainability.

Python code Structures

There …


This content originally appeared on DEV Community and was authored by David Bosah

Code Structure

This is the arrangement of code in a programming language. it encompasses the use of formatting techniques like whitespace and indentation. The goal of a good structure is reliability and maintainability.

Python code Structures

There are various parameters that are used in describing the Python language. There are basic ones that you must grasp. Let's look at some of them:

Comments:
These are used to make the code easy to understand. They start with "#"

Variables:
They are used to store data or values in your code.

Function:
They are used to exercise a certain function once called. They are either built in function or user defined function.

Data Types
Python Supports lots of built in data types including strings and integers.

Operators:
They are used to perform different operations on data and variables.

Let's Apply these Structures:

#This right here is a comment

#Defining Variables
a=10
y="happy"

#Defining Arithmetic operation
answer= a+8

#Now for functions 
#Examples of built in functions

Print()
Input()

#For user defined functions

Def Applaud (name)
Print("congratulations + name + !")

#Using the function

Applaud ("Meghan")


This content originally appeared on DEV Community and was authored by David Bosah


Print Share Comment Cite Upload Translate Updates
APA

David Bosah | Sciencx (2024-06-22T14:26:23+00:00) UNDERSTANDING PYTHON CODE STRUCTURE. Retrieved from https://www.scien.cx/2024/06/22/understanding-python-code-structure/

MLA
" » UNDERSTANDING PYTHON CODE STRUCTURE." David Bosah | Sciencx - Saturday June 22, 2024, https://www.scien.cx/2024/06/22/understanding-python-code-structure/
HARVARD
David Bosah | Sciencx Saturday June 22, 2024 » UNDERSTANDING PYTHON CODE STRUCTURE., viewed ,<https://www.scien.cx/2024/06/22/understanding-python-code-structure/>
VANCOUVER
David Bosah | Sciencx - » UNDERSTANDING PYTHON CODE STRUCTURE. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/06/22/understanding-python-code-structure/
CHICAGO
" » UNDERSTANDING PYTHON CODE STRUCTURE." David Bosah | Sciencx - Accessed . https://www.scien.cx/2024/06/22/understanding-python-code-structure/
IEEE
" » UNDERSTANDING PYTHON CODE STRUCTURE." David Bosah | Sciencx [Online]. Available: https://www.scien.cx/2024/06/22/understanding-python-code-structure/. [Accessed: ]
rf:citation
» UNDERSTANDING PYTHON CODE STRUCTURE | David Bosah | Sciencx | https://www.scien.cx/2024/06/22/understanding-python-code-structure/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.