Posts

Showing posts from March, 2023

Course Six - Operators in Python

Image
Operators in Python By  ienex Operators are symbols that perform operations on variables or values . For example, in the expression 4 + 5 = 9 , the numbers 4 and 5 are operands, and + is the operator. Python provides several types of operators, including: Arithmetic Operators Comparison (Relational) Operators Assignment Operators Logical Operators Bitwise Operators Identity Operators Membership Operators Operator Precedence 1. Arithmetic Operators Arithmetic operators perform basic mathematical operations . Example: a = 21 b = 10 c = 0 c = a + b print("Line 1 - Value of c is", c) c = a - b print("Line 2 - Value of c is", c) c = a * b print("Line 3 - Value of c is", c) c = a / b print("Line 4 - Value of c is", c) c = a % b print("Line 5 - Value of c is", c) a = 2 b = 3 c = a ** b print("Line 6 - Value of c is", c) a = 10 b = 5 c = a // b print("Line 7 - Value of c is", c) ...

Course Five - Transformation models in Python

Image
Transformation models in Python By  ienex In Python, variables are reserved locations in memory used to store values. When you create a variable, Python automatically allocates memory and determines what kind of data it can hold, such as integers, floating-point numbers, or strings. Assigning Values to Variables Variables in Python do not need explicit declaration . Memory is allocated automatically when a value is assigned using the = operator. # Python example counter = 100 # Integer assignment miles = 1000.0 # Floating-point assignment name = "John" # String assignment print(counter) print(miles) print(name) Output: 100 1000.0 John Multiple Assignment Python allows assigning the same value to multiple variables : a = b = c = 1 You can also assign different values to multiple variables at once: a, b, c = 1, 2, "John" Standard Data Types Python supports several standard data types that define how values are stored and manipu...

Course Four - The basic structure of the Python language

Image
The Basic Structure of Python By ienex Python is a versatile programming language with similarities to Perl, C, and Java , but it has its own unique features and syntax that make it simpler and more readable. Writing Your First Python Program Python allows you to write programs in two primary ways: interactive programming and scripting . 1. Interactive Programming In interactive mode, you can start the Python interpreter without passing a script file: $ python Python 2.4.3 (#1, Nov 11 2010, 13:34:43) [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> Type the following command: >>> print("Hello, Python!") The output will be: Hello, Python! Note: In older versions of Python (like 2.x), print statements may not require parentheses. 2. Scripting You can also write Python programs as script files with a .py extension. Example: # test.py print(...

Course Three - Python language Environment

Image
Python language Environment By ienex Python is a versatile programming language available on all major operating systems , including Linux, macOS, and Windows. Before you start coding, it’s important to set up a local Python environment on your device. Supported Platforms Python can be installed on a wide variety of platforms, including: Unix-based systems: Solaris, Linux, FreeBSD, AIX, HP/UX, SunOS, IRIX Windows: Windows 9x, NT, 2000, Windows CE macOS: Intel, PPC, 68K Other systems: OS/2, DOS, PalmOS, Nokia mobile phones, Acorn/RISC OS, BeOS, Amiga, VMS/OpenVMS, QNX, VxWorks, Psion To check if Python is already installed, open a terminal or command prompt and type: python This will display the installed Python version, if any. Downloading Python The official Python website, python.org , provides: Source code Binaries for different operating systems Documentation in HTML and PDF Download the version appropriate for your system. If a precompiled b...

Course Two - General idea about Python

Image
General idea about Python by  ienex Python is a high-level, interpreted, and interactive programming language designed with readability and simplicity in mind. Unlike many other programming languages that rely heavily on punctuation and complex syntax, Python uses English-like keywords and a straightforward structure, making it beginner-friendly and easy to understand. Python is purpose-oriented , meaning it allows developers to write code that clearly aligns with specific goals or functions. It can be executed directly using an interpreter, which eliminates the need for prior compilation—similar to languages like Perl and PHP. Key Characteristics of Python Interactive Language Python provides an interactive environment where programmers can write and execute code in real-time, making it ideal for testing, debugging, and learning. Purpose-Oriented Language Python supports structured programming models that allow developers to focus on clear, functional design. Begin...

Course One - Introduction to Python

Image
Introduction to Python By  ienex Welcome back to ienex blog! After exploring JavaScript, it’s time to dive into another powerhouse language: Python . Known for its simplicity and versatility, Python has become one of the most popular programming languages in the world. In this post, we’ll look at what Python is, what it can do, and why it’s worth learning. What You Should Know First Python is beginner-friendly, but having some knowledge of the basics will help you get started faster: Basic Computer Usage : Comfort with files, folders, and running programs. Optional : Familiarity with HTML or another language can make concepts easier, but it’s not required. Python is designed to be easy to learn, so it’s a great first language for anyone new to programming. What is Python? Python is a high-level, interpreted programming language that emphasizes readability and simplicity. Created by Guido van Rossum in 1991. Free and open-source, supported by a massive ...