×
Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Net Meeting
Tutorix
Categories
Java
JSP
iOS
HTML
Android
Python
C Programming
C++ Programming
C#
PHP
CSS
Javascript
jQuery
SAP
SAP HANA
Data Structure
RDBMS
MySQL
Mathematics
8085 Microprocessor
Operating System
Digital Electronics
Analysis of Algorithms
Mobile Development
Front End
Web Development
Selenium
MongoDB
Computer Network
General Topics
Library
Videos
Q/A
eBooks
Library
Videos
eBooks
Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
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
93
Answers
How to Sort Words in Alphabetic Order using Python?
Python
Server Side Programming
Programming
Jayashree
Published on 25-Feb-2018 19:10:13
Assuming that the a string object contains multiple words separated by one space. The split() method of string class returns a list of words separated by space character. This list object is sorted by invoking sort() method of built-in list class>>> string='Hello how are you?' >>> list=string.split() >>> list ['Hello', ...
Read More
How to Find Factors of Number using Python?
Python
Server Side Programming
Programming
Jayashree
Published on 25-Feb-2018 19:04:06
In order to find factors of a number, we have to run a loop over all numbers from 1 to itself and see if it is divisible.Examplenum=int(input("enter a number")) factors=[] for i in range(1, num+1): if num%i==0: factors.append(i) print ("Factors of {} = {}".format(num, ...
Read More
How to Find Armstrong Number in an Interval using Python?
Python
Server Side Programming
Programming
Jayashree
Published on 25-Feb-2018 18:54:51
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
How to Find the Factorial of a Number using Python?
Python
Server Side Programming
Programming
Jayashree
Published on 24-Feb-2018 10:44:38
Factorial of a number is the product of all integers between 1 and itself. To find factorial of a given number, let us form a for loop over a range from 1 to itself. Remember that range() function excludes the stop value. Hence stop value should be one more than ...
Read More
How to Print all Prime Numbers in an Interval using Python?
Python
Server Side Programming
Programming
Jayashree
Published on 24-Feb-2018 10:37:32
Prime number is defined as a number not divisible by any other number except 1 and itself. Hence to ascertain that a number is prime, it should be checked for divisibility by all numbers between 1 and itself excluding both.Following program lists all prime numbers between 1 to 100. Outer ...
Read More
How to Find the Sum of Natural Numbers using Python?
Python
Server Side Programming
Programming
Jayashree
Published on 24-Feb-2018 10:25:20
You can use while loop to successively increment value of a variable i by one and adding it cumulatively.s, i=0, 0 n=10 while i<n: i=i+1 s=s+i print ("sum of first 10 natural numbers", s)For loop is also used to loop over a range of natural numbers and add ...
Read More
How to Find Factorial of Number Using Recursion in Python?
Python
Server Side Programming
Programming
Jayashree
Published on 24-Feb-2018 10:15:16
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
How to Count the Number of Vowels in a string using Python?
Python
Server Side Programming
Programming
Jayashree
Published on 24-Feb-2018 10:06:47
Declare a string object containing all vowels.>>> vowels='aeiou'Set up a count variable initialize to 0>>> count=0Check if each character of input string belong to vowel string. If yes increment the count>>> string='Hello How are you?' >>> for s in string: if s in vowels: ...
Read More
How to know Maximum and Minimum values for ints in Python?
Python
Server Side Programming
Programming
Jayashree
Published on 24-Feb-2018 06:20:49
Python's core library has two built-in functions max() and min() respectively to find maximum and minimum number from a sequence of numbers in the form of list or tuple object.example>>> max(23, 21, 45, 43) 45 >>> l1=[20, 50, 40, 30] >>> max(l1) 50 >>> t1=(30, 50, 20, 40) >>> max(t1) ...
Read More
How to calculate absolute value in Python?
Python
Server Side Programming
Programming
Jayashree
Published on 24-Feb-2018 06:14:43
The abs() function of Python's standard library returns the absolute value of the given number. Absolute value of a number is the value without considering its sign. Hence absolute of 10 is 10, -10 is also 10. If the number is a complex number, abs() returns its magnitude.Example>>> abs(11.11) 11.11 ...
Read More
Previous
1
...
4
5
6
7
8
9
10
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout