Posts

Showing posts with the label code

Variable & Data Types (Session 3)

 Variable: A variable is a name given to a memory location in a program.  Variables do not need to be declared with any particular  type , and can even change type after they have been set. For example: a = 28 b =21.26 c ="Mustajab" In short, we can say that here variable is a container to store a value . Example: x = 28 y =  "Mustajab" print (x) print (y) Here Mustajab is str type and 28 is int type. Many Values to Multiple Variables: Python allows us to assign values to multiple variables in one line: x, y, z =  "Student1" ,  "Student2" ,  "Student3" print (x) print (y) print (z) Rules for defining a variable name:  A variable name can contain alphabets, digits, and underscore. A variable name can only start with an alphabet and underscore. A variable can’t start with a digit. No white space is allowed to be used inside a variable name. Task : Read about Whitespace Characters in Python. Data Type: Python is a great language that...

Python Basics (Introduction)

Image
What is Programming? Just like we use Urdu or English and other languages to communicate with each other, we use a Programming language to communicate with the computer. Programming is a way to instruct the computer to perform various tasks. What is Python: Python is a simple and easy-to-understand language that feels like reading simple English.  It works on Pseudo code nature which makes it easy to learn and understandable for beginners. Features: Easy to understand = Less development time Free and open source High-level language Portable – works on Windows/Linux/Mac Syntax: The syntax of the Python programming language is  the set of rules which defines how a Python program will be written.  Python is a friendly language. It has a simple and easy-to-learn syntax. Moreover, its features are easy to use, which allows you to write short and readable code. While,  C++ is a bit complex when it comes to the simplicity of language, and it has more syntax rules. What is P...

Python Installation

Image
  How to Install Python on Windows 10 We can install Python in these simple steps: Download the binaries. Run the executable installer. Add python to PATH environmental variables. Step 1: Download the Python Installer binaries: Open the  official Python website  in your web browser.You can choose the version of Python you wish to install. It is recommended to install the latest version of Python. Click on the link to download  Windows x86 executable installer  if you are using a 32-bit installer. In case your Windows installation is a 64-bit system, then download  Windows x86-64 executable installer . Step 2: Run the Executable Installer: Once the installer is downloaded, run the Python installer. Check the  Install launcher for all users  check box. Further, you may check the  Add Python 3.7 to path  check box to include the interpreter in the execution path. Follow the following steps for further installation.    4. Click on...