Back to early work

Card Game — Early Python Logic Exercise

An early Python console game that randomly selected cards, compared values, declared a winner, and allowed repeated play through user input.

Overview

Card Game was an early Python learning project from 2018. The program randomly selected a card for the computer and a card for the user, compared their face values, declared a winner or tie, and allowed the game to continue until the user chose to exit. This project is simple, but it is useful in the Early Work archive because it shows Parth's early exposure to Python, randomness, loops, conditionals, lists, and console interaction. This project helps show the foundation of Parth's programming journey. It demonstrates that his early work was not limited to Arduino and hardware; he was also practising Python logic and small interactive programs in 2018.

Problem solved

The project was mainly a learning exercise: building a small playable program to understand how random selection, comparison logic, and repeated user interaction work in Python.

What it does

The script defines card suits and faces, randomly chooses cards for both sides, compares their ranks, prints the result, and asks the user whether to continue playing.

Contribution

Parth wrote the Python console-game logic, including lists, random choices, conditional comparison, loop control, and user input handling.