![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
Lakshmi Srinivas has Published 315 Articles
![Lakshmi Srinivas](https://www.tutorialspoint.com/assets/profiles/13528/profile/60_91717-1512651120.jpg)
Lakshmi Srinivas
610 Views
You will need to use a multiprocessing library. You will need to spawn a new process and provide the code to it as an argument. For example, from multiprocessing import Processdef loop_a(): for i in range(5): print("a") def loop_b(): for i in range(5): ... Read More
![Lakshmi Srinivas](https://www.tutorialspoint.com/assets/profiles/13528/profile/60_91717-1512651120.jpg)
Lakshmi Srinivas
6K+ Views
Python provides two ways to write inline if statements. These are:1. if condition: statement2. s1 if condition else s2Note that second type of if cannot be used without an else. Now you can use these inline in a print statement as well. For example, a = True if a: print("Hello")This ... Read More
![Lakshmi Srinivas](https://www.tutorialspoint.com/assets/profiles/13528/profile/60_91717-1512651120.jpg)
Lakshmi Srinivas
192 Views
From the Python docs:Operators in the same box group left to right (except for comparisons), including tests, which all have the same precedence and chain from left to right — see section Comparisons — and exponentiation, which groups from right to left).So the ** operator(exponentiation) is right to left associative. ... Read More
![Lakshmi Srinivas](https://www.tutorialspoint.com/assets/profiles/13528/profile/60_91717-1512651120.jpg)
Lakshmi Srinivas
325 Views
You can put comments like you normally would anywhere in a python script. But note that you can only put single line comments using #. Multiline comments act like strings and you cannot put just a string in between definition of a dict. For example, the following declaration is perfectly ... Read More
![Lakshmi Srinivas](https://www.tutorialspoint.com/assets/profiles/13528/profile/60_91717-1512651120.jpg)
Lakshmi Srinivas
128 Views
You can sort a list of dictionaries by values of the dictionary using the sorted function and passing it a lambda that tells which key to use for sorting. For example, A = [{'name':'john', 'age':45}, {'name':'andi', 'age':23}, {'name':'john', 'age':22}, {'name':'paul', 'age':35}, {'name':'john', ... Read More
![Lakshmi Srinivas](https://www.tutorialspoint.com/assets/profiles/13528/profile/60_91717-1512651120.jpg)
Lakshmi Srinivas
126 Views
You can first construct a list then change the single value you want to change, then finally convert that to a tuple if you want to create a non-literal python tuple. For example, def create_non_literal_tuple(a, b, c): x = [1] * a x[c] = b return tuple(x) ... Read More
![Lakshmi Srinivas](https://www.tutorialspoint.com/assets/profiles/13528/profile/60_91717-1512651120.jpg)
Lakshmi Srinivas
472 Views
One way to create an array of hash tables is to create Hashtable objects and to assign these to a Hashtable array using curly braces:ExampleLive Demoimport java.util.Hashtable; public class HashTableOfArrays { public static void main(String args[]) { Hashtable ht1 = new Hashtable(); ... Read More
![Lakshmi Srinivas](https://www.tutorialspoint.com/assets/profiles/13528/profile/60_91717-1512651120.jpg)
Lakshmi Srinivas
166 Views
This method returns a CanvasGradient object that represents a radial gradient that paints along the cone given by the circles represented by the arguments. The first three arguments define a circle with coordinates (x1, y1) and radius r1 and the second a circle with coordinates (x2, y2) and radius r2.createRadialGradient(x0, ... Read More