Featured Post

How to Build CI/CD Pipeline: GitHub to AWS

Image
 Creating a CI/CD pipeline to deploy a project from GitHub to AWS can be done using various AWS services like AWS CodePipeline, AWS CodeBuild, and optionally AWS CodeDeploy or Amazon ECS for application deployment. Below is a high-level guide on how to set up a basic GitHub to AWS pipeline: Prerequisites AWS Account : Ensure access to the AWS account with the necessary permissions. GitHub Repository : Have your application code hosted on GitHub. IAM Roles : Create necessary IAM roles with permissions to interact with AWS services (e.g., CodePipeline, CodeBuild, S3, ECS, etc.). AWS CLI : Install and configure the AWS CLI for easier management of services. Step 1: Create an S3 Bucket for Artifacts AWS CodePipeline requires an S3 bucket to store artifacts (builds, deployments, etc.). Go to the S3 service in the AWS Management Console. Create a new bucket, ensuring it has a unique name. Note the bucket name for later use. Step 2: Set Up AWS CodeBuild CodeBuild will handle the build proces

How to Use For loop List Option Quickly

For loop is main concept in Python programming. Out of all the For Loop options, the list option is so popular. If you know, how to use this concept, you can write any number of programs quickly and with less effort.

Using for loop you can get index for list items. You can print list elements using for loop.

If you take any language, the loops play a vital role.
for loop using list in python

How to Use For Loop

When you want to deal with data of multiple values, you need loops. So, For Loop is so famous because, you can control multiple input values.

Syntax to Write For Loop

       
for i in my_list:
    print(i)
       
 

The 'i' says variable that represents value in the 'my_list'. The for helps to iterate the list values one by one.

Example Program For Loop List in Python

           my_list=[2,3,4]
           for i in my_list:
                print(i)       
 

Result

           2
           3
           4

How to create Multiplication Table using Python For-Loop List Option.

Function to create table
Function to create table

Result of function that generated Multiplication Table 

 
how to create table in python
Creating multiplication table in python

Bottom Line

  1. You can use for loop to calculate Factorial and listing values one by one.
  2. Your input data contains multiple values, then For loop is so useful.

References

  1. SanFoundary for Python Sample Programs

Top Courses

Top Books
  1. Taming Python by Programming

Comments

Popular posts from this blog

How to Fix datetime Import Error in Python Quickly

How to Check Kafka Available Brokers

SQL Query: 3 Methods for Calculating Cumulative SUM