Posted in allcategorites programs in python python simple programs python-short-tutorial

Python | Delete object of a class

Output: Rakesh 50000 Amit 60000 Rakesh 50000 Traceback (most recent call last): File “C:\CopyAssignment.py”, line 14, in <module> print(obj2.name, obj2.salary) NameError: name ‘obj2’ is not…

Continue Reading
Posted in allcategorites programs in python python simple programs python-short-tutorial

Python | Modify properties of objects 

Output: Amit 60000

Continue Reading
Posted in allcategorites programs in python python simple programs python-short-tutorial

Python classmethod

Output: Your numbers-> 88

Continue Reading
Posted in allcategorites programs in python python simple programs python-short-tutorial

Python | Create a class that takes 2 parameters, print both parameters

Output: Rakesh 50000Amit 60000

Continue Reading
Posted in allcategorites programs in python python simple programs python-short-tutorial

Python | Create a class, create an object of the class, access, and print property value

Output: 10

Continue Reading
Posted in allcategorites programs in python python simple programs

Python | Find the maximum element in a list using lambda and reduce()

Output: 40

Continue Reading
Posted in allcategorites programs in python python simple programs

Python | filter numbers(that are not divisible by 3 and 4) from a list using lambda and filter()

Output: [12, 24, 36]

Continue Reading
Posted in allcategorites programs in python python simple programs

Python | lambda function that returns the maximum of 2 numbers

Output: Enter numbers: 1 2 2

Continue Reading
Posted in allcategorites programs in python python simple programs

Python | Convert all strings of a list to uppercase using lambda

Output: [‘ONE’, ‘TWO’, ‘THREE’]

Continue Reading
Posted in allcategorites programs in python python simple programs

Python | Square numbers of a list using lambda

Output: [1, 4, 9, 16, 25]

Continue Reading