Skip to content

Homework 1 for *Math Applications in CS*: 1. Prime factorization of an integer 2. Finding the most profitable store 3. Getting all digit indices in a string

Notifications You must be signed in to change notification settings

YairDayan/MathApplicationsHW1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Math Applications – Introductory Python Scripts

This project includes Python scripts that solve basic algorithmic tasks:

  • Prime factorization of a number
  • Identifying the store with the highest total profit
  • Finding all indices of a digit in a given string

Files

  • 211819958-Q1HW1.py:
    Checks if a number is prime and computes its prime factorization based on user input.

  • 211819958-Q2HW1.py:
    Determines which store has the highest total profit from a given list.

  • 211819958-Q3HW1.py:
    Finds all indices of a specific digit in a user-provided string (e.g., ID number).

Usage

  1. Prime Factorization
    Run 211819958-Q1HW1.py and enter a number when prompted. The script will return its prime factorization.

  2. Best Store by Profit
    Run 211819958-Q2HW1.py to see which store has the highest total profit.

  3. Find Digit Indices
    Run 211819958-Q3HW1.py, then input a string and a digit. The script will return the positions where the digit appears.

Requirements

  • Python 3.x
  • No external libraries needed

Author

Yair Dayan

Feel free to reach out for questions or feedback.

About

Homework 1 for *Math Applications in CS*: 1. Prime factorization of an integer 2. Finding the most profitable store 3. Getting all digit indices in a string

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages