Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
31 views

Python - ICT Practical Practice

This document outlines 16 Python programs for practicing different coding concepts using loops and conditional statements. The programs cover checking if a number is in a sequence, printing ranges using for loops, checking if a number is in a range, printing given values, printing square numbers, calculating factorials, generating Fibonacci series, printing natural numbers with while loops, finding multiples and their sum in a range, and creating infinite loops. The document provides the purpose and output of each program.

Uploaded by

fab456mon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Python - ICT Practical Practice

This document outlines 16 Python programs for practicing different coding concepts using loops and conditional statements. The programs cover checking if a number is in a sequence, printing ranges using for loops, checking if a number is in a range, printing given values, printing square numbers, calculating factorials, generating Fibonacci series, printing natural numbers with while loops, finding multiples and their sum in a range, and creating infinite loops. The document provides the purpose and output of each program.

Uploaded by

fab456mon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

PYTHON ICT Practical practice

PROGRAM 1

A code for checking if 20 is in the sequence or not.


Output: True
PROGRAM 2

A code for checking whether the number entered the user is in the sequence or not.
Output: False
PROGRAM 3

A code for printing all terms in the range using for loop.
Output: 2,4,6,8,10
PROGRAM 4

A code for checking if 2 is in the range 1 to 10 or not.


Output: True
PROGRAM 5

A code for checking if 3 is in the range or not.


Output: False
PROGRAM 6

A code for printing the given values.


Output: 20,30
PROGRAM 7

A code for printing square numbers.


Output: Square numbers of 11 to 20 (21-1)
PROGRAM 8

A code for printing the factorial of any number entered by the user.
Output: number: 6 Factorial: 720
PROGRAM 9

A code for printing the Fibonacci series of any number entered by the user.
Output: number: 7 Series: 0+1=1, 1+1=2, 2+3=5, 3+5=8, 5+8=13 and 8+13=21.
PROGRAM 10

A code for printing the first 10 natural numbers using while loop.
Output: Numbers from 1 to 10.
PROGRAM 11

A code for printing the square numbers from 10 to 20 using while loop.
Output: Squares of numbers 10-19.
PROGRAM 12

A code for printing the multiples of 3 and their sum in the range 10 to 30
using while loop.
Output: Multiples of 3 from 10 to 30 and their sum.
PROGRAM 13

A code for printing the table of any number given by the user using
while loop.
Output: Table of any number.
PROGRAM 14

A code to display no output using while loop.


Output: No output
PROGRAM 15

A code to create an infinite loop using while loop.


Output: Never ending values.
PRACTICE

A code for finding the sum of even numbers using for loop.
Note: The number till 18 have been added as in the range the last value is 20-1=19.
PRACTICE

A code for finding the sum of even numbers using while loop.
Note: The numbers till 20 have been added as in the condition I is less than or equal to 20.
PRACTICE

A code for checking if any number entered by the user is a multiple of 5 or not using the
remainder.
PRACTICE

A code for making a Fibonacci series.


PRACTICE

A code for printing the factorial of any number.


PRACTICE

A code for printing the first 10 natural numbers with for and while loop
PRACTICE

A code for printing the sum of the first 10 natural numbers with for and while loop
PRACTICE

A code for printing the table of 3 using for and while loop.
Thank you!
For your guidance and support ma’am.

You might also like