Method overloading example in python
-
admin
-
February 25, 2018
-
Python
-
218 Comments
class Localbus: def sayLocal(self, busName=None): if busName is not None: print(‘Hello ‘ + busName) else: print(‘Hello ‘) obj = Localbus() obj.sayLocal() obj.sayLocal(‘Alif’) Output ============= Hello Hello Alif class Human: def sayHello(self, name=None, age=None): if name is not None and age is None: print(‘Hello ‘ + name) elif age is not None and age is not None: print(‘Hello ‘,name, ‘ your …
Continue Reading
‘python’ is not recognized as an internal or external command
-
admin
-
July 16, 2017
-
Python
-
144 Comments
It’s very simple, just modify python install. just follow image.
Continue Reading
How to check python version ?
-
admin
-
April 9, 2017
-
Python
-
0 Comments
python -V
Continue Reading
Why Python for Data Analysis?
-
zendnwar
-
June 20, 2016
-
Python
-
0 Comments
Python has become one of the most popular dynamic,programming languages, along with Perl, Ruby, and others. Python and Ruby havebecome especially popular in recent years for building websites using their numerous web frameworks, like Rails (Ruby) and Django (Python). Such languages are often called scripting languages as they can be used to write quick-and-dirty small programs,or scripts. I don’t like the term …
Continue Reading
Python String Operations
-
zendnwar
-
May 8, 2016
-
Python
-
0 Comments
Concatenation >>>’Zend’ + ‘Anwar’ Zendanwar >>>’Zend’ *3 ZendZendZend Iterating Through String >> count = 0 >>> for str in ‘Zend Anwar’: if(str == ‘n’): count += 1 >>> print(count, “String Found”) 2 String Found
Continue Reading
Syntax of Python Function
-
zendnwar
-
April 19, 2016
-
Python
-
0 Comments
def functionname(parameters): “””docstring””” statement(s) return expression Example: #!/usr/bin/python # Function definition is here def ima( lovestr ): “This prints a passed string into this function” print lovestr return; # Now you can call ima function ima(“I’m fall in love!”)
Continue Reading
Star triangle with python for loop
-
zendnwar
-
April 16, 2016
-
Python
-
0 Comments
>>> star = input(“Enter the star to draw: “) Enter the star to draw: * >>> limit = int(input(“Enter the limit: “)) Enter the limit: 10 >>> for i in range(1, limit+1): print (star*i) Output– * ** *** **** ***** ****** ******* ******** ********* **********
Continue Reading
Python continue
-
zendnwar
-
April 16, 2016
-
Python
-
0 Comments
>>> for var in “zend-anwar”: if var == “-“: continue print (var) output– z e n d a n w a r
Continue Reading
Python break
-
zendnwar
-
April 16, 2016
-
Python
-
0 Comments
>>> for var in “zend-anwar”: if var == “-“: break print (var) output— z e n d
Continue Reading
How to show hostname & IP address with python programming
-
zendnwar
-
April 13, 2016
-
Python
-
0 Comments
The Internet Protocol assigns a 4-byte address to every computer connected to the network. Such addresses are usually written as four decimal numbers, separated by periods, which each represent a single byte of the address. Each number can therefore range from 0 to 255. So an IP address looks like this: 202.168.3.180 Because purely numeric addresses can be difficult for …
Continue Reading