Skip to content

EleniTsiotaki/Python-Assignments

Repository files navigation

Python Assignments

University Coursework Repository – contains Python programs from assignments.

📘 Overview

This repository includes four Python scripts, each solving a different problem: file processing, Fibonacci numbers & primality, API data fetching, and a random SOS game simulation.

📂 Files

12.py – ASCII File Processing

  • Reads a text file given by the user.
  • Reverses words and their characters.
  • Creates a “mirror” transformation of the text using ASCII codes.

2.py – Fibonacci & Primality Check

  • Computes the n-th Fibonacci number.
  • Tests if it is prime using Fermat’s primality test (20 iterations).
  • Prints whether the number is prime or not.

3.py – OPAP Lottery Results (API)

  • Fetches lottery draw results from the OPAP API.
  • Iterates from the start of the month to the current day.
  • Prints the first winning draw of each day.

5.py – SOS Game Simulation

  • Asks user for rectangle dimensions.
  • Fills a grid randomly with "S" and "O".
  • Counts horizontal, vertical, and diagonal "SOS" patterns.
  • Repeats 100 times and calculates the average number of “SOS” found.

🏗️ Tech Stack

  • Python 3

  • Libraries Used:

    • random, math, datetime, urllib, json

▶️ Usage

Run any script with:

python filename.py

Example:

python 2.py

Each script runs independently and prompts user input or prints results.


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages