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.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
799 views3 pages
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.