count arguments

#!/usr/bin/python
import sys
print len(sys.argv)


OUTPUT:
[root@mysql Scripts]# python argu.py
1
[root@mysql Scripts]# python argu.py 3
2
[root@mysql Scripts]# python argu.py 3 2
3
[root@mysql Scripts]# python argu.py 3 2 4
4
[root@mysql Scripts]# python argu.py 3 2 4 6
5
[root@mysql Scripts]# python argu.py 3 2 4 6 7 8
7

Comments

Popular posts from this blog

How to delete SEA in VIOS

Webmin configuration for LDAP

Sample questions and answers for AWS Associate Solutions Architect Certification ---> AWS exam dumps