## AS400/IBM iSeries Beginners

### 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 It is an optional command but becomes mandatory only when we are receiving parameters from external programs. It is mandatory to specify the parameter in the PGM command if the program accepts input parameters. Example…

## Python Beginners

### 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 First n number divisible by 5 using while loop Output: Output of first n number divisible by 5

### Lists in Python

1) What is List? List is one of the most common collection datatypes. It is used to store a group of an element together in a sequence. Individual values in a list is called elements. The elements will be stored in a contiguous memory location. Ex: Number1 = 10, Number2 = 20, Number3 = 30, Number4 = 40 These individual variables can be represented in a list Number_list = [ 10, 20, 30, 40 ] Indexing: In list, each element has a position known as an index. Index number always starts from 0…

### 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) Display sum 1 to 10 number by using for loop Output: Output of display sum 1 to 10 number 2) Program to search a value in a list We can code this logic using simple if condition also. code: ''' To search a value in a list using for…

### Sample programs: Functions basics

Simple programs - solution for practice: Copy and try on your own. 1) First 10 prime numbers program in python code: n = 10 count=0 answer=[] print("First ten prime no program in Python") for i in range(1,n+1): for j in range(2,n+1): if i % j == 0: count+=1 if count == 1: answer.append(i) count=0 print(answer) First 10 prime number program in Python Output: Output of prime number program 2) Write a program to set any two numbers to calculate the sum, difference, product, and division. Print…

### Sample programs: Functions basics

Simple programs - solution for practice: Copy and try on your own. 1) First 10 prime numbers program in python code: n = 10 count=0 answer=[] print("First ten prime no program in Python") for i in range(1,n+1): for j in range(2,n+1): if i % j == 0: count+=1 if count == 1: answer.append(i) count=0 print(answer) First 10 prime number program in Python Output: Output of prime number program 2) Write a program to set any two numbers to calculate the sum, difference, product, and division. Print…

### 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 First n number divisible by 5 using while loop Output: Output of first n number divisible by 5

### Sample programs: Functions basics

Simple programs - solution for practice: Copy and try on your own. 1) First 10 prime numbers program in python code: n = 10 count=0 answer=[] print("First ten prime no program in Python") for i in range(1,n+1): for j in range(2,n+1): if i % j == 0: count+=1 if count == 1: answer.append(i) count=0 print(answer) First 10 prime number program in Python Output: Output of prime number program 2) Write a program to set any two numbers to calculate the sum, difference, product, and division. Print…

### Sample programs: Functions basics

### Lists in Python

1) What is List? List is one of the most common collection datatypes. It is used to store a group of an element together in a sequence. Individual values in a list is called elements. The elements will be stored in a contiguous memory location. Ex: Number1 = 10, Number2 = 20, Number3 = 30, Number4 = 40 These individual variables can be represented in a list Number_list = [ 10, 20, 30, 40 ] Indexing: In list, each element has a position known as an index. Index number always starts from 0…

### Sample programs: Functions basics

### Sample programs: Functions basics

### 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) Display sum 1 to 10 number by using for loop Output: Output of display sum 1 to 10 number 2) Program to search a value in a list We can code this logic using simple if condition also. code: ''' To search a value in a list using for…

### 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) Display sum 1 to 10 number by using for loop Output: Output of display sum 1 to 10 number 2) Program to search a value in a list We can code this logic using simple if condition also. code: ''' To search a value in a list using for…

### Sample programs: Functions basics

### Lists in Python

1) What is List? List is one of the most common collection datatypes. It is used to store a group of an element together in a sequence. Individual values in a list is called elements. The elements will be stored in a contiguous memory location. Ex: Number1 = 10, Number2 = 20, Number3 = 30, Number4 = 40 These individual variables can be represented in a list Number_list = [ 10, 20, 30, 40 ] Indexing: In list, each element has a position known as an index. Index number always starts from 0…

### Sample programs: Functions basics

### For loop - Python practice program

## Other Pins

### 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 First n number divisible by 5 using while loop Output: Output of first n number divisible by 5