Skip to content

servinovich/python-basics

Repository files navigation

🐍 Python Basics Portfolio

This repository contains a collection of beginner-friendly Python scripts that demonstrate core programming concepts such as user input, conditionals, exception handling, and object-oriented programming. Each file is self-contained and interactive.

Files and Descriptions

script_1_greeting.py

Prompts the user to enter their name and prints a friendly greeting.

📎 Concepts: input(), f-strings, console output 🧪 Example:

Enter your name: Alex
Hello, Alex! Welcome to my portfolio with Python basics.

script_2_even_check.py

Checks whether the input number is even or odd, with error handling for invalid inputs. 📎 Concepts: try/except, modulus operator, input conversion 🧪 Example:

Enter a number: 13
The number is odd.

script_3_compare.py

Checks if a player meets a set of conditions based on their sport and number of achievements. Uses or in a conditional statement to evaluate if either criterion is satisfied. 📎 Concepts: logical operators (or), string formatting, conditionals 🧪 Example Output:

Roger Federer meets the criteria! They play Tennis and have 20 achievements.

script_4_save_div.py

Safely divides two user-provided numbers and handles zero-division and type errors. 📎 Concepts: try/except/finally, function definition, input handling 🧪 Example:

Enter a numerator: 10
Enter a denominator: 0
Error: Cannot divide by zero.
Processing Complete.

script_5_class.py

Defines a Vehicle class and creates two instances with different properties. Demonstrates class structure, constructors, and methods. 📎 Concepts: OOP, class attributes and methods, object creation 🧪 Example Output:

Properties of Vehicle: 
Model: Honda
Color: white
Max speed: 250
Miles: 20
Capacity: 4

🚀 Getting Started

To run any of the scripts:

python script\_name.py

📚 Skills Demonstrated

* Variables and data types
* User input and output
* Conditional logic
* Exception handling
* Functions and return values
* Object-oriented programming

Additional Documentation and Acknowledgments

About

A personal portfolio of beginner Python exercises covering logic, functions, and classes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages