- 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
31K+ Views
In C, ++ and -- operators are called increment and decrement operators. They are unary operators needing only one operand. Hence ++ as well as -- operator can appear before or after the operand with same effect. That means both i++ and ++i will be equivalent.i=5; i++; printf("%d", i);and i=5 ++i; printf("%d", ... Read More
Jayashree
9K+ Views
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
Jayashree
4K+ Views
Python enumerate() function takes any iterable as argument and returns enumerate object using which the iterable can be traversed. It contains index and corresponding item in the iterable object like list, tuple, or string.Such enumerate object with index and value is then converted to a dictionary using dictionary comprehension.>>> l1=['aa', ... Read More
Jayashree
2K+ Views
In this article, we will show you how to find the largest integer less than x in python. The Greatest Integer Function [X] denotes an integral part of the real number x that is the closest and smallest integer to x. It's also called the X-floor. [x]=the largest integer less ... Read More
Jayashree
612 Views
Leap year comes after every four years. For normal year, if it is divisible by four, it is called leap year, whereas for century year, it should be divisible by 400. The following Python program shows whether the year is leap or notExampleyr=int(input('enter year')) if yr%100==0: #century year if yr%400==0: ... Read More
Jayashree
111 Views
The uniform() function is defined in the random module of the standard Python library. It returns a random floating-point number between a given range of numbers>>> import random >>> random.uniform(10,100) 20.118467024396452 >>> random.uniform(10,100) 23.739576765885502
Jayashree
1K+ Views
The random module in the Python standard library provides a shuffle() function that returns a sequence with its elements randomly placed.>>> import random >>> l1=['aa',22,'ff',15,90,5.55] >>> random.shuffle(l1) >>> l1 [22, 15, 90, 5.55, 'ff', 'aa'] >>> random.shuffle(l1) >>> l1 ['aa', 'ff', 90, 22, 5.55, 15]
Jayashree
199 Views
The seed() method of random module initializes the random number generator.random.seed(a, b)If a is omitted or None, the current system time is used. If randomness sources are provided by the operating system, they are used instead of the system timeIf a is an int, it is used directly.With version 2 (the default), ... Read More
Jayashree
434 Views
To extract each digit from a string −>>> str1='a34e 345 bcd 5he 78 xyz' >>> for s in str1: if s.isdigit():print (s) 3 4 3 4 5 5 7 8To extract only integers from a string in which words are separated by space character −>>> str1='h3110 23 cat 444.4 ... Read More
Jayashree
4K+ Views
Assuming that the list is collection of strings, the first character of each string is obtained as follows −>>> L1=['aaa', 'bbb', 'ccc'] >>> for string in L1: print (string[0]) a b cIf list is a collection of list objects. First element of each list is obtained as follows −>>> ... Read More
To Continue Learning Please Login
Login with Google