While loop

What is While loop in Python?
  • A While loop in Python is used to execute a set of statements/ iterate over a block of code repeatedly as long as the given condition is true.
  • While loop is preferred when we don't know the number of iterations.
Syntax:
                    while condition:
                            body statements
  • The body statement of the while loop is separated from the rest of the code using indentation [tab].

For loop

What is For loop in Python?
  • A for loop in python has the ability to iterate over items of any sequence (List, tuple, string) or any other iterable objects.
  • Iterating over a sequence is called traversal.
Syntax:
                    for var in sequence:
                            body statements
    
  • Here, var is a variable that is used to take the next values from the sequence on every iteration until the end of the sequence is reached.

If, If...else, If...elif...else, Nested If

What is selection statement in Python?
  • In some cases in programming, Our program has to decide whether the following block of codes needs to be executed or not, based on some conditions.
  • Such Decision making statements/selection statements decide the direction of flow of program execution.
  • Decision making statements/selection statements available in Python are
        • if (Simple If)
        • if-else
        • else-if ladder
        • Nested if
  • In python, body statements inside the selection statement are indicated by the indentation. The very first unindented line marks the end of the selection statements.

Dictionaries in Python

What is Dictionary in python?
  • Dictionary is an unordered collection of data in the form of key-value pair.
  • First element in the key-value pair is the key and the second element is the value.
  • Like list, dictionaries are mutable.
Creating a dictionary
  • Dictionaries are written inside curly brackets ({}) with comma-separated key-value pairs.

Tuples in Python

1) What is Tuple?
  • Just like List, Tuple is a collection of ordered element. But the difference between list and Tuple is, tuples are immutable i.e. the elements in the Tuple cannot be changed, once it is assigned.
  • Tuples also can store both homogeneous and heterogeneous elements.
2) Creating a Tuple
  • Tuples can be created by placing all the elements separated by commas inside parentheses().

Sets in python

What is Set?
  • Set is an unordered collection data type with no duplicate elements. (unique elements)
  • Using curly braces {} or keyword set, we can create a set in Python.
  • In general, the set function is used to eliminate duplicate elements in a list.

Python Comments

Python Comments:
  • Comments are the lines that are used to make your code more readable.
  • Comment lines are mainly used for documentation purposes to make the readers understand the source code.
  • These are the lines that are skipped during the execution of the program by the compilers and the interpreters.
  • Sometimes, comments can also serve to prevent the execution of a line when testing code.
  • There are three types of comments in python.
    • Single line comments 
    • Multi-line comments
    • Docstring comments

For loop - Python practice program

For loop - Python practice program:

Copy and try on your own.
1) Display sum 1 to 10 number by using for loop

    code:
    '''Display sum 1 to 10 number by using for loop'''
    n=10
    ans=0
    for i in range(1,n+1):
        ans+=i
    print("Sum of 1 to 10 number using for loop:",ans)

While loop - Python practice programs

While loop - Python practice programs:

Copy and try on your own.
1) Find first n numbers divisible by 5 using while loop

    code:
    '''first n numbers divisible by 5'''
    n=int(input("Enter n:"))
    while(n>0):
        if n%5 == 0:
            print(n, end=',')

        n-=1

How to get free AS400 profile and windows client access - PUB400 Registration

Get your free AS400 profile

In this post, I will show you how to get a free AS400 profile by registering in PUB400.com and IBMi Access for windows.

We will see step by step.

Step 1:
  • Go to PUB400.com. This PUB400 domain offers you a free AS400 profile and 300MB of disk storage in the IBM server and two private libraries.
  • Click on "Signup now" to register.

What is the use of PGM and ENDPGM in CL program

PGM and ENDPGM in CL program:

In this blog post, we will see what is the use of PGM and ENDPGM commands in a CL program. First, we will start with the PGM command.

PGM Command
  • In general, PGM command is written to identify the beginning of a CL program.
  • Example:
PGM Command

Engineering Maths - Handwritten Study Notes

Here, we have given  Engineering Mathematics Study Notes for TNEB TANGEDCO AE Exam. Candidates can download Topic Wise Engineering Mathematics Study Materials along with Previous Year Questions from below mentioned links.

Study Notes:

๐Ÿ“ŒMatrices and Determinants

Question Papers:

๐Ÿ“ŒTANCET 2016 - Eng. Maths

๐Ÿ“ŒTANCET 2017 - Eng. Maths

Introduction to CL program

CL programming language:

In this blog post, I will make you understand what is CL and what can and cannot be done by using the CL language.
  • CL is a control language that contains a set of AS/400 commands which execute in a sequence to control the flow of an application.
  • It is used for job controlling just like JCL in the mainframe.
  • So to understand the CL program, we should be knowing all CL commands

Structure of CL program

Structure of basic CL program

In this blog post, I will take you through how the basic structure of the CL program will be.
In General,

  • CL Code is case insensitive.
  • Source code usually starts from column 14 with an indentation for readability.
Source code starts from column 14
  • Every programing language has some notation for adding comments which are used for future reference. Likewise in CL, Comments are marked by /* at the beginning and */ at the end.