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
419 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
542 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
748 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,952 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
314 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
441 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
604 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,779 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
578 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,315 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,296 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
520 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,414 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
701 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
509 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
519 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
583 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,573 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
10,997 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
632 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
632 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
673 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
498 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
530 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
441 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,190 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,317 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,481 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
337 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,768 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,012 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,286 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
451 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
421 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
398 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,718 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
830 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,170 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,053 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,102 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
507 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,248 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
626 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
839 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
436 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
873 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
879 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
457 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,255 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
554 views