This repository contains solutions for multiple Python assignments.
Write a Python program that executes a list of OS commands and displays the output in the form of a dictionary.
- Executes multiple shell commands
- Removes duplicate commands
- Continues execution even if one command fails
- Displays:
- command output
- error message
- execution status
- Python 3
- subprocess module
- Q1-Python-execute_commands.txt
Starting with 1 and spiraling anticlockwise, find the side length of the square spiral for which the ratio of primes along both diagonals first falls below 10%.
- Generates spiral diagonal numbers
- Checks prime numbers efficiently
- Calculates ratio of prime numbers
- Stops when ratio becomes less than 10%
Side Length: 26241- problem58.py
Implementation of Conway’s FRACTRAN Prime Generating Algorithm using Python.
- Simulates Conway's FRACTRAN execution
- Generates prime exponents using powers of 2
- Displays iteration count and generated primes
- Uses fraction-based computation
Iteration: 19
Generated value: 2^2
Iteration: 69
Generated value: 2^3
Iteration: 281
Generated value: 2^5The number of iterations required to generate:
2^104743(where 104743 is the 10001st prime number)
is:
127093784615867- problem308.py
- Python 3
Jatin Pal