Skip to content

lingengyuan/python-learning

Repository files navigation

Python Learning

A small collection of practice scripts built while learning the Python basics. Each file focuses on a simple topic so you can run and experiment with them one by one.

Getting Started

  • Install Python 3.
  • Run any script with python3 <file_name> from the project root.
  • Scripts with spaces in their names need quotes, for example python3 "Branch structure.py".

What Each File Covers

  • helloworl.py: first "hello world" print.
  • variable.py: integers, booleans, strings, floats, type conversion, and character codes.
  • operators_demo.py: arithmetic, assignment, comparison, logical operations, and a Celsius-to-Fahrenheit calculation.
  • Branch structure.py: conditional logic plus Heron's formula to validate triangle sides.
  • Loop Structure.py: for loops, a number-guessing while loop, and a multiplication table.
  • List.py: list creation, concatenation, mutation methods, enumeration, and a dice-roll counter using randomness.
  • functions_and_collections.py: reusable functions, list comprehensions, dictionary updates, tuples, sets, and summary statistics.

Notes

  • The guessing game and triangle check require user input in the terminal.
  • Feel free to tweak the examples and re-run them to see how the output changes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages