- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Jayashree has Published 41 Articles
![Jayashree](https://www.tutorialspoint.com/assets/profiles/15002/profile/60_183575-1514465925.jpg)
Jayashree
177 Views
Python has an in-built function isdigit() which returns true if all characters in a string are digit (between 0-9)>>> string='9764135408' >>> string.isdigit() True >>> string='091-9764135408' >>> string.isdigit() FalseYou can also use regex expression to check if string contains digits only.>>> import re >>> bool(re.match('^[0-9]+$', '9764135408')) True >>> bool(re.match('^[0-9]+$', '091-9764135408')) FalseRead More
![Jayashree](https://www.tutorialspoint.com/assets/profiles/15002/profile/60_183575-1514465925.jpg)
Jayashree
901 Views
The random module in Numpy package contains many functions for generation of random numbersnumpy.random.rand() − Create an array of the given shape and populate it with random samples>>> import numpy as np >>> np.random.rand(3, 2) array([[0.10339983, 0.54395499], [0.31719352, 0.51220189], [0.98935914, 0.8240609 ]])numpy.random.randn() − Return a sample (or samples) from the ... Read More
![Jayashree](https://www.tutorialspoint.com/assets/profiles/15002/profile/60_183575-1514465925.jpg)
Jayashree
219 Views
Floor and modulus operators (// and % respectively) are not allowed to be used on complex number in Python 3.x. However, these operations are defined for complex numbers in Python 2.7.xPython 3>>> x=9+2j >>> y=2+1j >>> x%y Traceback (most recent call last): File "", line 1, in x%y TypeError: ... Read More
![Jayashree](https://www.tutorialspoint.com/assets/profiles/15002/profile/60_183575-1514465925.jpg)
Jayashree
675 Views
LCM (Least common multiple) of two (or more) numbers is a number which is the smallest number that is divisible by both (or all).First we find the larger number of two given numbers. Starting from it we try and find the first number that is divisible by both, which is ... Read More
![Jayashree](https://www.tutorialspoint.com/assets/profiles/15002/profile/60_183575-1514465925.jpg)
Jayashree
277 Views
The keys() method of Python dictionary class returns a view object consisting of keys used in the dictionary.>>> d1 = {'name': 'Ravi', 'age': 21, 'marks': 60, 'course': 'Computer Engg'} >>>d1.keys() dict_keys(['name', 'age', 'marks', 'course'])It can be stored as a list object. If new key-value pair is added, the view object ... Read More
![Jayashree](https://www.tutorialspoint.com/assets/profiles/15002/profile/60_183575-1514465925.jpg)
Jayashree
696 Views
If sum of cubes of individual digits in a number add up to the number itself, it is called armstrong number. for example 153=1**3+5**3+3**3ExampleFollowing Python program find armstrong numbers between 100 to 1000for num in range(100, 1000): temp=num sum=0 while temp>0: digit=temp%10 ... Read More
![Jayashree](https://www.tutorialspoint.com/assets/profiles/15002/profile/60_183575-1514465925.jpg)
Jayashree
677 Views
Factorial of a number is product of all numbers from 1 to that number.A function is called a recursive function if it calls itself.In following program factorial() function accepts one argument and keeps calling itself by reducing value by one till it reaches 1.Exampledef factorial(x): if x==1: ... Read More