Most answered questions in Python

0 votes
1 answer

Using generator function in Python

A generator is effectively a function that ...READ MORE

Oct 29, 2018 in Python by Priyaj
• 58,090 points
429 views
0 votes
1 answer

Read input of integers in Python

In the upper version of Python 3.x, raw_input was ...READ MORE

Oct 26, 2018 in Python by Priyaj
• 58,090 points
560 views
0 votes
1 answer

How to implement Linked List in Python?

You can use Deque that works better than linked list ...READ MORE

Oct 26, 2018 in Python by Priyaj
• 58,090 points
763 views
0 votes
1 answer

How to use HashMap in Python?

You can use Python dictionary it is a built-in type ...READ MORE

Oct 26, 2018 in Python by Priyaj
• 58,090 points
4,964 views
0 votes
1 answer

Python debugging tips

You can use the pdb module, insert ...READ MORE

Oct 26, 2018 in Python by SDeb
• 13,300 points
319 views
0 votes
1 answer

Understanding generators in Python

A generator is simply a function which ...READ MORE

Oct 26, 2018 in Python by SDeb
• 13,300 points
447 views
0 votes
1 answer

Understanding Python's slice notation

It's pretty simple really: a[start:end] # items start ...READ MORE

Oct 25, 2018 in Python by SDeb
• 13,300 points
614 views
0 votes
1 answer

How to use multiprocessing queue in Python?

This is a simple example of a ...READ MORE

Oct 25, 2018 in Python by SDeb
• 13,300 points
5,801 views
0 votes
1 answer

In python how to test a string for a substring

if "ABCD" in "xxxxABCDyyyy": This can be used ...READ MORE

Oct 24, 2018 in Python by Priyaj
• 58,090 points
588 views
0 votes
1 answer

Python: Glob() to find files recursively

import os, fnmatch def find_files(directory, pattern): ...READ MORE

Oct 24, 2018 in Python by Priyaj
• 58,090 points
1,326 views
0 votes
1 answer

how to read a JSON from a file?

You can use with statement with open('strings.json') as ...READ MORE

Oct 24, 2018 in Python by Priyaj
• 58,090 points
5,316 views
0 votes
1 answer

How can I print Lists in python

print is a function in Python 3.x, so ...READ MORE

Oct 24, 2018 in Python by Priyaj
• 58,090 points
534 views
0 votes
1 answer

'foreach' function in Python 3?

Yes, there is a "foreach" in python. ...READ MORE

Oct 24, 2018 in Python by Priyaj
• 58,090 points
8,424 views
0 votes
1 answer

Break for loop in an if statement

You'll need to break out of each ...READ MORE

Oct 23, 2018 in Python by SDeb
• 13,300 points
707 views
0 votes
1 answer

What is a “method” in Python?

It's a function which is a member ...READ MORE

Oct 23, 2018 in Python by SDeb
• 13,300 points
520 views
0 votes
1 answer

How do I append one string to another in Python?

If you only have one reference to ...READ MORE

Oct 22, 2018 in Python by SDeb
• 13,300 points
532 views
0 votes
1 answer

String.strip() in Python

If you can comment out code and ...READ MORE

Oct 22, 2018 in Python by SDeb
• 13,300 points
587 views
0 votes
1 answer

How to read Excel File in Python

With pandas it is possible to get ...READ MORE

Oct 22, 2018 in Python by Priyaj
• 58,090 points
1,576 views
0 votes
1 answer

How to convert date string to date object in python?

Use this :-  >>> datetime.datetime.strptime('24052010', "%d%m%Y").date() datetime.date(2010, 5, 24) Hope ...READ MORE

Oct 22, 2018 in Python by Priyaj
• 58,090 points
11,017 views
0 votes
1 answer

How to capture exception message in Python

You have to define which type of ...READ MORE

Oct 22, 2018 in Python by Priyaj
• 58,090 points
635 views
0 votes
1 answer

Download a file over HTTP using Python

In Python 2, use urllib2 which comes ...READ MORE

Oct 22, 2018 in Python by Priyaj
• 58,090 points
680 views
0 votes
1 answer

How to download a file over HTTP using Python?

In Python 2, use urllib2 which comes ...READ MORE

Oct 18, 2018 in Python by SDeb
• 13,300 points
688 views
0 votes
1 answer

Convert floating point number to a certain precision

With Python < 3 (e.g. 2.6 [see ...READ MORE

Oct 18, 2018 in Python by SDeb
• 13,300 points
508 views
0 votes
1 answer

Re-assigning a name to itself

This code occurs in multiprocessing.dummy, a "fake" ...READ MORE

Oct 17, 2018 in Python by ana1504.k
• 7,910 points
544 views
0 votes
1 answer

What is set() function used for?

Sets are unordered, as you say. Even ...READ MORE

Oct 17, 2018 in Python by Priyaj
• 58,090 points
442 views
0 votes
1 answer

What is equivalent for 'foreach' in Python

Its also interesting to observe this To iterate ...READ MORE

Oct 17, 2018 in Python by findingbugs
• 4,780 points
2,208 views
0 votes
1 answer

How can I Iterate over dictionaries using 'for' loops

key is just a variable name. for key in ...READ MORE

Oct 17, 2018 in Python by Priyaj
• 58,090 points
1,330 views
0 votes
1 answer

Python equivalent for static variables within a function?

You can use the following code, that ...READ MORE

Oct 17, 2018 in Python by Priyaj
• 58,090 points
4,495 views
0 votes
1 answer

What is Python division

You're using Python 2.x, where integer divisions ...READ MORE

Oct 17, 2018 in Python by Priyaj
• 58,090 points
342 views
0 votes
1 answer

Access Webcam using Python?

OpenCV has support for getting data from ...READ MORE

Oct 17, 2018 in Python by ana1504.k
• 7,910 points
2,774 views
0 votes
1 answer

How to convert a Unicode string to string

It can be done in the following ...READ MORE

Oct 16, 2018 in Python by SDeb
• 13,300 points
1,027 views
0 votes
1 answer

Create a nested directory in Python

Try os.path.exists, and consider os.makedirs for the ...READ MORE

Oct 16, 2018 in Python by SDeb
• 13,300 points
1,310 views
0 votes
1 answer

What are the utiliy of python Language

At the very begining Python started as ...READ MORE

Oct 15, 2018 in Python by Priyaj
• 58,090 points
462 views
0 votes
1 answer

To simulate construct of other language does Python have a ternary conditional operator?

You can index into a tuple: (falseValue, trueValue)[test] test needs ...READ MORE

Oct 15, 2018 in Python by findingbugs
• 4,780 points
431 views
0 votes
1 answer

Run a Python program?

In IDLE press F5 You can open your ...READ MORE

Oct 15, 2018 in Python by Priyaj
• 58,090 points
410 views
0 votes
1 answer

How to Parse values from a JSON file?

import json from pprint import pprint with open('data.json') as ...READ MORE

Oct 15, 2018 in Python by Priyaj
• 58,090 points
1,728 views
0 votes
1 answer

What is the use of “assert” keyword in Python?

You can try the following in a ...READ MORE

Oct 15, 2018 in Python by Priyaj
• 58,090 points
838 views
0 votes
1 answer

Use conditional statements to handle multi-line conditions

You don't need to use 4 spaces ...READ MORE

Oct 15, 2018 in Python by charlie_brown
• 7,720 points
2,191 views
0 votes
1 answer

How can I logarithmic axes with matplotlib in python?

You can use the Axes.set_yscale method. That allows you ...READ MORE

Oct 15, 2018 in Python by charlie_brown
• 7,720 points
2,060 views
0 votes
1 answer

Which IDE can be used for Python on Mac OS X

Have tried many different (Kate, Eclipse, Scite, ...READ MORE

Oct 15, 2018 in Python by SDeb
• 13,300 points
1,111 views
0 votes
1 answer

What does hash do in python?

A hash is an fixed sized integer ...READ MORE

Oct 15, 2018 in Python by SDeb
• 13,300 points
518 views
0 votes
1 answer

How do I convert a Python program to a runnable .exe Windows program?

Understand that every 'freezing' application for Python ...READ MORE

Oct 13, 2018 in Python by SDeb
• 13,300 points
1,259 views
0 votes
1 answer

Python division

You're using Python 2.x, where integer divisions ...READ MORE

Oct 13, 2018 in Python by SDeb
• 13,300 points
635 views
0 votes
1 answer

How can I print an Error in Python?

For Python 2.6 and later and Python ...READ MORE

Oct 12, 2018 in Python by aryya
• 7,450 points
847 views
0 votes
1 answer

What does enumerate mean?

The enumerate() function adds a counter to ...READ MORE

Oct 11, 2018 in Python by SDeb
• 13,300 points
438 views
0 votes
1 answer

Python constructors and __init__

There is no function overloading in Python, ...READ MORE

Oct 11, 2018 in Python by SDeb
• 13,300 points
881 views
0 votes
1 answer

Which is the best IDE for Python For Windows

Python is dynamic language so the IDE ...READ MORE

Oct 10, 2018 in Python by Priyaj
• 58,090 points
890 views
0 votes
1 answer

How to move searchbar in Plone5

You can install the add-on Products.ContentWellPortlets and ...READ MORE

Oct 10, 2018 in Python by Priyaj
• 58,090 points
461 views
0 votes
1 answer

tf.reshape vs tf.contrib.layers.flatten

All 3 options reshape identically: import tensorflow as ...READ MORE

Oct 10, 2018 in Python by Priyaj
• 58,090 points
2,280 views
0 votes
1 answer

how to get mongoengine object id in flask program

Check out the documentation, Document.objects is a QuerySet object. You seem to be ...READ MORE

Oct 10, 2018 in Python by Priyaj
• 58,090 points
562 views