Showing posts with label python class in bopal-ahmedabad. Show all posts
Showing posts with label python class in bopal-ahmedabad. Show all posts

Friday, March 13, 2020

Why there is no switch statement in python? - tccicomputercoaching.com

Switch case is a powerful decision-making construct commonly used in modular programming .

Unlike other programming languages, Python doesn’t provide a switch case instrument over the self.



However, it has many other constructs like a dictionary, lambda function, and classes to write a custom implementation of the Python switch case statement.

One example of Switch in Python :

Here, we define a function week() to tell us which day a certain day of the week is. A switcher is a dictionary that performs this mapping.



As you can see, for values other than the ones we mention in the switcher, it prints out “Invalid day of week”. This is because we tell it to do so using the get() method of a dictionary.

TCCI teach so many Programming Languages to Diploma-Degree Engineering students, School students ,BCA ,MCA , PGDCA , BSC_IT , and any Non-IT person.

We are at Bopal and Satellite.

Call us @ 8980010210

Visit us @ www.tccicomputercoaching.com

Thursday, December 6, 2018

What is Inheritance? tccicomputercoaching.com

Inheritance is a feature of Object Oriented Programming . It is used to specify that one class will get most or all of its features from its parent class. It is a very powerful feature which facilitates users to create a new class with a few or more modification to an existing class. The new class is called child class or derived class and the main class from which it inherits the properties is called base class or parent class.



The child class or derived class inherits the features from the parent class, adding new features to it. It facilitates re-usability of code.

Python Inheritance Syntax

baseclass as per previous example

1. class DerivedClassName(BaseClassName):
2. <statement-1>
3. .
4. .
5. .
6. <statement-N>

Here we always use object of parent type.

object=baseclass()

This child type object will call both module of parent and child.

TCCI computer coaching institute teach python and other programming Languages in Ahmedabad.
"Online Coaching is also available...."

Any student, any person can learn any course at tcci.

Call us @ 9825618292

Visit us @ http://tccicomputercoaching.com/course/