Skip to content

This repository contains a collection of simple Python programs designed to demonstrate basic programming concepts. Each program focuses on a specific task or algorithm, providing a practical example of how to implement it in Python.

Notifications You must be signed in to change notification settings

rezapace/python-program

Repository files navigation

Simple Python Programs

Description

This repository contains a collection of simple Python programs designed to demonstrate basic programming concepts. Each program focuses on a specific task or algorithm, providing a practical example of how to implement it in Python.

Programs

Program 1: Conditional Statements

  • If the score is less than or equal to 40, the grade is D.
  • If the score is less than 61, the grade is C.
  • If the score is less than 81, the grade is B.
  • Otherwise, the grade is A.

Program 2: Output Statements

  • Output: "Your score is 50"
  • Output: "Sorry, you did not pass"

Program 3: Odd Numbers

  • Display odd numbers from 1 to 100.

Program 4: Triangle Area Calculator

  • Function to calculate the area of a triangle with parameters:
    • Base
    • Height

Program 5: String Character Count

  • Display the number of characters in a string.
  • Input string: "Programmer"

Program 6: Triangle Area Calculation

  • Calculate the area of a triangle.

Program 7: Rectangle Area Calculator

  • Function to calculate the area of a rectangle with parameters:
    • Length
    • Width

Program 8: Circle Area Calculator

  • Calculate the area of a circle with:
    • π = 3.14
    • Radius = 7

Program 9: Even Numbers

  • Display even numbers from 1 to 75.

Program 10: Days of the Week Array

  • Create an array containing the names of the days from Monday to Sunday.
  • Example:
    • Day 1 is Monday
    • Day 2 is Tuesday

Program 11: Fibonacci Sequence

  • Display the first 5 Fibonacci numbers with:
    • First term = 6
    • Second term = 9

Program 12: Right-Angled Triangle with Stars

  • Create a right-angled triangle using stars.

Program 13: Full Triangle with Stars

  • Create a full triangle using stars.

Program 14: Simple Calculator

  • Implement a basic calculator.

Program 15: Rectangle Area Calculation

  • Calculate the area of a rectangle.

Program 16: Rectangle Area Calculation

  • Calculate the area of a rectangle.

Program 17: Trigonometric Functions

  • Calculate sine, cosine, and tangent angles.

Program 18: Density Calculation

  • Calculate density.

Program 19: Counting to One Million

  • Count from 1 to 1,000,000 and display the record.

Program 20: Cube Surface Area Calculation

  • Calculate the surface area of a cube.

Program 21: Odd Numbers

  • Display odd numbers from 1 to 75.

Powered by Reza

About

This repository contains a collection of simple Python programs designed to demonstrate basic programming concepts. Each program focuses on a specific task or algorithm, providing a practical example of how to implement it in Python.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages