Skip to content

Sumamasonia/CodeAlpha_Tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Code Alpha โ€“ Python Projects

This repository contains tasks completed as part of my Code Alpha internship.
The projects showcase practical problem-solving using Python, with applications in games and finance.


๐Ÿ“‚ Projects

1๏ธโƒฃ Hangman Game (hangman_game.py)

A console-based word guessing game where the player has limited attempts to guess a randomly chosen word.

Features

  • Random word selection from a list (python, code, alpha, intern, project)
  • Tracks previously guessed letters
  • Maximum of 6 incorrect attempts before game over
  • Displays current progress after each guess
  • Win/lose messages with fun emojis ๐ŸŽฎ

Sample Run ๐ŸŽฎ Welcome to Hangman!

Guess a letter: o โŒ Wrong guess. Attempts left: 5

Guess a letter: p โœ… Correct guess! p _ _ _ _ _

... ๐ŸŽ‰ Congratulations! You guessed the word: python

๐Ÿ‘‰ View Code


2๏ธโƒฃ Stock Portfolio Tracker (stock_portfolio_tracker.py)

A simple finance utility program to track investments in stocks using hardcoded stock prices.

Features

  • Add stocks to a portfolio (AAPL, TSLA, GOOGL, AMZN, MSFT)
  • Enter quantities for each stock
  • Calculates portfolio value and total investment
  • Option to save results into a portfolio.txt file

Sample Run ๐Ÿ“Š Welcome to the Stock Portfolio Tracker! Enter stock symbol (or 'done' to finish): AAPL Enter quantity for AAPL: 10 Enter stock symbol (or 'done' to finish): MSFT Enter quantity for MSFT: 5 Enter stock symbol (or 'done' to finish): done

๐Ÿ“ˆ Portfolio Summary: AAPL: 10 x $180 = $1800 MSFT: 5 x $300 = $1500

๐Ÿ’ฐ Total Investment: $3300 Save to file? (yes/no): yes ๐Ÿ“ Saved to 'portfolio.txt'

๐Ÿ‘‰ View Code


๐Ÿ› ๏ธ Tools & Skills Used

  • Python 3
  • Built-in libraries:
    • random (for word selection in Hangman)
    • File handling (for portfolio saving)
  • Concepts applied:
    • Loops & conditionals
    • Lists and dictionaries
    • User input handling
    • File I/O

๐Ÿš€ How to Run

  1. Clone this repository:
    git clone https://github.com/Sumamasonia/code-alpha-tasks.git
    

2.Navigate to the folder: cd code-alpha-tasks

3.Run a project: python hangman_game.py or python stock_portfolio_tracker.py

About

Hangman game and Stocks Tracker Portfolio for Python practice (CodeAlpha Internship Task 1 & 2)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages