python

learn kro favicon img

Python Dictionary

What is a Dictionary in Python? A Dictionary in Python is the unordered and changeable collection of data values that holds key-value pairs. Each key-value pair in the dictionary maps the key to its associated value making it more optimized. A Dictionary in python is declared by enclosing a comma-separated list of key-value pairs using curly braces({}). …

Python Dictionary Read More »

learn kro favicon img

Python TUPLE

In Python, a tuple is an immutable sequence data type that can contain elements of different types. Tuples are similar to lists, but they are defined using parentheses instead of square brackets. Here is an example of defining a tuple in Python:

You can access the elements of a tuple using indices, just like …

Python TUPLE Read More »

learn kro favicon img

How to Run Python Scripts

To run a Python script, you will need to have Python installed on your machine and the script itself. Here is a step-by-step guide for running a Python script:

Alternatively, you can use the ./ notation to run the script directly, if it is executable:

The script will be executed, …

How to Run Python Scripts Read More »

learn kro favicon img

How to check the Python Version

To check the Python version on a Windows, Mac, or Linux machine, you can use the following command at the command prompt or in a script:

This command will print the version of Python that is currently installed on your machine. To check the Python version from a script, you can use the following …

How to check the Python Version Read More »