This document provides examples of 7 basic Python programs: 1) Find the sum of two numbers. 2) Subtract two numbers. 3) Print the multiplication table of a number. 4) Find the factorial of a number. 5) Find the sum of the first n natural numbers. 6) Reverse a string. 7) Determine if a number is even or odd. Each program example lists the expected input and output.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
511 views
20 Python Programs
This document provides examples of 7 basic Python programs: 1) Find the sum of two numbers. 2) Subtract two numbers. 3) Print the multiplication table of a number. 4) Find the factorial of a number. 5) Find the sum of the first n natural numbers. 6) Reverse a string. 7) Determine if a number is even or odd. Each program example lists the expected input and output.