Giter VIP home page Giter VIP logo

truco.py's Introduction

Card Game For Learning Python Creating a Game

Description:

Using a this tutorial(https://copyassignment.com/python-oop-projects-source-code-and-example/) i will learn OOP programming and create a card game.

Tutorial Concepts:

Introduction We all know that Python is a vast language that supports many libraries for almost every work we need to do. But, we should also practice OOP concepts in Python as these are the fundamental needs of industry-level projects. We should create Python OOP projects to get our hands dirty with Python OOP concepts. Today we will explore the most famous Python projects which can be developed with Python OOP concepts. But, before that, let’s get a brief introduction to OOP concepts in Python.

What is OOP? OOP or object-oriented programming is a computer science model that revolves around the use of objects as basic entities in a program. The aim of OOP is that the data should not be accessible from outside the designated functions and also to reduce redundant or duplicate codes and provide an easy to use and simple interface for the users. OOP consists of Object, Class, Methods, and the 4 pillars of OOP.

Object: An object is used to represent a real-life entity and it can be anything like a car, person, employee, or something abstract that contains certain properties and functions. Class: Class is the blueprint through which objects are created. They define the structure and functions of the objects. The class allows the creation of multiple objects of the same type without the need to repeat code. Method: A method is a collection of lines of code that perform a specific task. This could be as simple as printing to the console or performing complex calculations. They allow the reusability of code and save time.

The 4 pillars of OOP

Abstraction:

It is a property by which we hide unnecessary details from the user. For example, if a user wants to order food, he/she should only have to give order details and get the order acknowledgment, they do not need to know about how the order is processed internally or what mechanisms we are using. Abstraction does the work of simplifying the interface and the user only has to think about the input and output and not about the process.

Encapsulation:

Encapsulation is the process of binding the data with the code so that the data is not available externally or to unauthorized personnel. This is done by restricting access using access modifiers.

Inheritance:

Inheritance is the property by which a class is able to access the fields and methods of another class. The class inheriting these fields is called the subclass and the class whose fields are inherited is called the superclass. The sub-class can have additional fields and methods than those of the superclass. The purpose of inheritance is to increase code reusability and make the code more readable.

Polymorphism:

Polymorphism is the ability to have different methods with the same name but perform different tasks. It can be achieved through method overriding or method overloading. Method overriding is a subclass having a different implementation of the method than the parent class while method overloading is a function having different parameter types or number of parameters.

truco.py's People

Contributors

onurbsofa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.