Most viewed questions in Python

0 votes
0 answers

How to add "," in Json list (python) . Example ["A", "B"]["c", "d"] --> ["A", "B"],["c", "d"]

Apr 18, 2019 in Python by Ashish Mishra

recategorized Apr 19, 2019 by Omkar 414 views
0 votes
1 answer

While accessing array elements, which is better Pandas or NumPy?

Hi @Hannah, Panda series objects are more ...READ MORE

Nov 18, 2019 in Python by Eric
413 views
0 votes
1 answer

Python from Python: restricting functionality?

This doesn't seem like a good idea ...READ MORE

Jun 24, 2019 in Python by SDeb
• 13,300 points
413 views
0 votes
1 answer

please what does print_details do in python?

Hi, @There, The print() function prints the specified message to the ...READ MORE

Dec 23, 2020 in Python by Gitika
• 65,910 points
412 views
0 votes
1 answer

Accessing the index in 'for' loops?

Using an additional state variable, such as ...READ MORE

Dec 16, 2020 in Python by Gitika
• 65,910 points
412 views
0 votes
0 answers

What are the key advantages of using python over javascript?

Which one should i go for? READ MORE

Aug 26, 2019 in Python by Waseem
• 4,540 points
412 views
0 votes
0 answers

python reverse phone lookup with twilio

I've been trying to figure out how ...READ MORE

Nov 22, 2022 in Python by sarit
• 1,830 points
411 views
0 votes
1 answer

How to determine whether a substring is in a different string [duplicate]

with in: substring in string: >>> substring = "please help ...READ MORE

Nov 26, 2020 in Python by Gitika
• 65,910 points
411 views
0 votes
0 answers

How can you use html parser in python?

Is it only used while web scraping? What ...READ MORE

Jun 12, 2019 in Python by Waseem
• 4,540 points
411 views
0 votes
1 answer

can we sort the key value pairs in a dictionary?

we can use OrderedDict import collections result = colections.Ord ...READ MORE

Mar 22, 2019 in Python by Mohammad
• 3,230 points
411 views
0 votes
0 answers

Difference in the output of NMF.fit and NMF.transform function . Explain the interpretation of the output.

Nov 6, 2019 in Python by Neha
• 120 points

recategorized Nov 6, 2019 by Omkar 410 views
0 votes
1 answer

converting string into datetime

You can make use of asctime() method ...READ MORE

Aug 7, 2019 in Python by Wajiha
• 1,950 points
410 views
0 votes
1 answer

Installing second python on Debian

Get the Python 2.7.1 sources and compile ...READ MORE

Apr 26, 2019 in Python by SDeb
• 13,300 points
410 views
0 votes
1 answer

Creating a new dict in Python

Call dict with no parameters new_dict = dict() or simply write new_dict ...READ MORE

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

What exactly does the .join() method do?

Look carefully at your output: 5wlfgALGbXOahekxSs9wlfgALGbXOahekxSs5 ^ ...READ MORE

May 31, 2018 in Python by charlie_brown
• 7,720 points
410 views
0 votes
1 answer

How to pad zeroes to a string?

Strings: >>> n = '4' >>> print(n.zfill(3)) 004 And for numbers: >>> ...READ MORE

Dec 20, 2020 in Python by Gitika
• 65,910 points
409 views
0 votes
1 answer

Are Python sets mutable?

>>>> x = set([4, 5, 6]) Sets are ...READ MORE

Feb 18, 2022 in Python by CoolCoder
• 4,400 points
408 views
0 votes
1 answer

Why is Python scoping made the way it is?

The likeliest answer is that it just ...READ MORE

Nov 5, 2018 in Python by Nymeria
• 3,560 points

edited Dec 17, 2018 by Nymeria 408 views
0 votes
1 answer

Calling a function of a module by using its name (a string).

Assuming module foo with method bar: import foo method_to_call = getattr(foo, 'bar') result ...READ MORE

Nov 25, 2020 in Python by Gitika
• 65,910 points
407 views
–1 vote
0 answers

Python Challenge : Writing a file

Write a sign up program for a ...READ MORE

Sep 4, 2019 in Python by Waseem
• 4,540 points
407 views
0 votes
0 answers

How can you raise a ValueError in python?

Can you give an example to show ...READ MORE

Jun 3, 2019 in Python by Waseem
• 4,540 points
407 views
0 votes
1 answer

what does this line fout.write("</{}>\n".format(opentags.pop())) do?

It closes one tag actually, opentags is ...READ MORE

Nov 10, 2020 in Python by Gitika
• 65,910 points
406 views
0 votes
1 answer

What are sorted container in python?

Sorted Containers is an Apache2 licensed sorted ...READ MORE

May 28, 2019 in Python by Alok
406 views
0 votes
0 answers

'for' loop in one line in Python

When I tried to use a for statement in ...READ MORE

Nov 24, 2022 in Python by sarit
• 1,830 points
405 views
0 votes
0 answers

is therer an alternative for execfile in python?

can you give an example if there ...READ MORE

Apr 5, 2019 in Python by Waseem
• 4,540 points
405 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
405 views
0 votes
1 answer

Combine list items to a string

>>> stmt = ['this','is','a','statement'] >>> ' '.join(sentence) 'this is ...READ MORE

Jun 7, 2018 in Python by Hamartia's Mask
• 1,580 points
405 views
0 votes
1 answer

How to install biopyhton if import is not recognised as a command by the system?

Hello, For install biopyhton with proper instruction you can ...READ MORE

Oct 12, 2020 in Python by Niroj
• 82,880 points
404 views
0 votes
1 answer

What is the procedure to install python packages in IPython?

You can use the '!' prefix like ...READ MORE

Aug 21, 2019 in Python by Neel
• 3,020 points
403 views
0 votes
1 answer

kwargs in Python

kwargs in **kwargs is just variable name. You can very ...READ MORE

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

Using exceptions in Python

They are used for control flow. Check ...READ MORE

Jun 14, 2018 in Python by Nietzsche's daemon
• 4,260 points
402 views
0 votes
1 answer

Reversing strings in Python

The fastest way to reverse string is ...READ MORE

May 7, 2018 in Python by Nietzsche's daemon
• 4,260 points
402 views
0 votes
0 answers

Base language of Python

What is the base language is Python ...READ MORE

Sep 21, 2022 in Python by Samuel
• 460 points
401 views
0 votes
0 answers

What is python image library?

How to install python image library? READ MORE

Sep 3, 2019 in Python by Waseem
• 4,540 points
401 views
0 votes
1 answer

How can you use a single insert statement into three tables from three different classes in python

you can use executescript() method : This is ...READ MORE

May 23, 2019 in Python by Mihir
401 views
0 votes
0 answers

how to print string to text file?

can you give an example? READ MORE

Apr 3, 2019 in Python by Waseem
• 4,540 points
401 views
0 votes
1 answer

Checking for empty list

Empty objects in python by default have ...READ MORE

Apr 24, 2018 in Python by Nietzsche's daemon
• 4,260 points
401 views
0 votes
0 answers

What is dictionary comprehension in python?

Is it possible to do dictionary comprehension ...READ MORE

Sep 6, 2019 in Python by Waseem
• 4,540 points
400 views
0 votes
0 answers

Python list error: step on slice with [:-1]

I believed I was familiar with the ...READ MORE

Nov 17, 2022 in Python by Samuel
• 460 points
399 views
0 votes
0 answers

attribute error

AttributeError: 'edureka' object has no attribute 'name' READ MORE

Feb 19, 2020 in Python by Jeya
• 120 points
398 views
0 votes
0 answers

how to print all the roles used by windows instances.

Mar 12, 2019 in Python by Smith
398 views
0 votes
1 answer

init.py file

It is used to denote directories on ...READ MORE

Jul 20, 2018 in Python by Nietzsche's daemon
• 4,260 points
398 views
0 votes
1 answer

Static methods in Python?

Yep, using the static method decorator class MyClass(object): ...READ MORE

Dec 2, 2020 in Python by Gitika
• 65,910 points
396 views
0 votes
0 answers

How to return None if Dictionary key is not available?

I need a way to get a ...READ MORE

Apr 13, 2020 in Python by kartik
• 37,510 points
396 views
0 votes
0 answers

how does sorted function works in python?

How are the arguments passed in the ...READ MORE

Jul 19, 2019 in Python by Waseem
• 4,540 points
396 views
0 votes
1 answer

Convert dictionary keys to a list

list.(dictionary.keys()) READ MORE

Jun 28, 2018 in Python by Hamartia's Mask
• 1,580 points
396 views
0 votes
1 answer

Using quotes in python

Both the conventions for enclosing strings are ...READ MORE

May 9, 2018 in Python by Nietzsche's daemon
• 4,260 points
396 views
0 votes
1 answer

How do I get the number of elements in a list

The len() function can be used with several different ...READ MORE

Feb 15, 2022 in Python by CoolCoder
• 4,400 points
395 views
0 votes
0 answers

how do i perform XML parsing in python?

can you give me the python code ...READ MORE

Apr 10, 2019 in Python by Waseem
• 4,540 points
394 views