Most viewed questions in Python

0 votes
1 answer

While debugging in visual studio it runs but it doesn't show any error

You're sending infinitely increasing data. Maybe it's ...READ MORE

Nov 15, 2020 in Python by Gitika
• 65,910 points
277 views
0 votes
0 answers

How to return dictionary keys as a list in Python?

Now, in Python >= 3.3, I get something ...READ MORE

Feb 18, 2022 in Python by Dev
• 6,000 points
275 views
0 votes
0 answers

How to use string.replace() in python 3.x

The string.replace() is deprecated on python 3.x. ...READ MORE

Feb 18, 2022 in Python by Dev
• 6,000 points
274 views
0 votes
1 answer

How can we initialise a variable like this a = -2.331*(e**-16)?

Remove stars and brackets. That's all READ MORE

Oct 14, 2020 in Python by anonymous
• 65,910 points
272 views
0 votes
0 answers
0 votes
1 answer

Iterating over dictionaries using 'for' loops

Here in this example the key is ...READ MORE

Feb 11, 2022 in Python by Dev
• 6,000 points
271 views
0 votes
0 answers

Quicksort with Python

I am totally new to python and ...READ MORE

Apr 26, 2022 in Python by Edureka
• 13,620 points
269 views
0 votes
0 answers

Does Python have a ternary conditional operator?

If Python doesn't have a ternary conditional operator, ...READ MORE

Apr 19, 2022 in Python by Edureka
• 13,620 points
269 views
0 votes
0 answers

How can you print the full traceback without affecting the program?

can you give an example? READ MORE

May 27, 2019 in Python by Waseem
• 4,540 points
267 views
0 votes
0 answers

Which python projects are good for beginner If I already know the basics very well?

Which python projects are good for beginner ...READ MORE

Nov 19, 2020 in Python by samar
• 120 points
266 views
0 votes
0 answers

How can you subtract a day from date?

Can you give an example? READ MORE

May 29, 2019 in Python by Waseem
• 4,540 points

edited May 30, 2019 by Omkar 266 views
0 votes
1 answer

Does "IndexError: list index out of range" when trying to access the N'th item mean that my list has less than N items?

IndexError occurs when the item you want ...READ MORE

Feb 16, 2022 in Python by Nandini
• 5,480 points
264 views
0 votes
0 answers

when do i use open in python?

also, give an example? READ MORE

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

How do I specify new lines on Python, when writing on files?

In Python \n is used for new ...READ MORE

Feb 14, 2022 in Python by Nandini
• 5,480 points
262 views
0 votes
0 answers

Why dict.get(key) instead of dict[key]?

Today, I came across the dict method get which, given a ...READ MORE

Feb 18, 2022 in Python by Dev
• 6,000 points
261 views
0 votes
1 answer

How to reverse a list?

A  list in Python can be reversed ...READ MORE

Feb 11, 2022 in Python by Dev
• 6,000 points
261 views
0 votes
0 answers

how can i pause a python program?

can you give the syntax ? READ MORE

Apr 5, 2019 in Python by Waseem
• 4,540 points
259 views
0 votes
0 answers

Is there a difference between "==" and "is"?

In Python, are the following two tests ...READ MORE

Feb 18, 2022 in Python by Dev
• 6,000 points
258 views
0 votes
0 answers

How do I do a case-insensitive string comparison?

How can I do case-insensitive string comparison ...READ MORE

May 26, 2022 in Python by Kichu
• 19,050 points
256 views
0 votes
0 answers

How to check whether a variable is a class or not?

I was wondering how to check whether ...READ MORE

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

How can I install XGBoost package in python on Windows

I am using windows 64bit os and ...READ MORE

May 26, 2022 in Python by Kichu
• 19,050 points
255 views
0 votes
1 answer

What does // means in Python?

In Python, when you use //, it ...READ MORE

Dec 29, 2023 in Python by Vani
248 views
0 votes
0 answers

how to merge two data frames based on particular column in pandas python?

I want to  merge two data frames: df1 company,standard tata,A1 cts,A2 dell,A3 df2 company,return tata,71 dell,78 cts,27 hcl,23 I ...READ MORE

May 26, 2022 in Python by Kichu
• 19,050 points
247 views
0 votes
1 answer

When to use "while" or "for" in Python?

while and for are both flow control ...READ MORE

Feb 9, 2022 in Python by Nandini
• 5,480 points
247 views
0 votes
0 answers

What does the "yield" keyword do?

What is the use of the yield ...READ MORE

Apr 26, 2022 in Python by Edureka
• 13,620 points
246 views
0 votes
1 answer

What is the algorithm to find the sum of prime numbers in the input in python

To find the sum of prime numbers ...READ MORE

Mar 1 in Python by Shubh Saxena
245 views
0 votes
0 answers

How do I execute a program or call a system command?

How do I call an external command ...READ MORE

Apr 24, 2022 in Python by Kichu
• 19,050 points
243 views
0 votes
0 answers

Function for factorial in Python

How do I go about computing a ...READ MORE

Apr 26, 2022 in Python by Edureka
• 13,620 points
242 views
0 votes
0 answers

In Python, retrieve color palettes from the website ColorHunt.co.

I am presently engaged in the development ...READ MORE

Sep 12, 2023 in Python by Satyawrat
• 460 points
239 views
0 votes
1 answer

How to Concatenate Lists in Python?

In Python, you can concatenate lists using ...READ MORE

Dec 29, 2023 in Python by Anu
237 views
0 votes
0 answers

what is wrong here?print ('We have logged in as{0.user}'.format(client))

I need to ask where I got ...READ MORE

Oct 17, 2021 in Python by anonymous
• 120 points
237 views
0 votes
0 answers

What is the primary language used to create Python?

What is the primary language used to ...READ MORE

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

Renaming column names in Pandas

How can  I change the column labels of ...READ MORE

May 5, 2022 in Python by Kichu
• 19,050 points
235 views
0 votes
1 answer

How do I upgrade the Python installation in Windows 10?

If you have 2.x or 3.x version ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 63,700 points
233 views
0 votes
0 answers

Is it possible to decorate classes?

Apr 24, 2022 in Python by Kichu
• 19,050 points
233 views
0 votes
0 answers

testing test test

This is the most active category where ...READ MORE

Feb 4, 2022 in Python by anonymous
• 300 points
232 views
0 votes
0 answers

Function for factorial in Python

How do I go about computing a ...READ MORE

Dec 21, 2022 in Python by erzan
• 630 points
231 views
0 votes
0 answers

How to terminate a script?

How to terminate a script in python? READ MORE

Apr 24, 2022 in Python by Kichu
• 19,050 points
231 views
0 votes
0 answers

Extract a page from a pdf as a jpeg

How can I  save a certain page ...READ MORE

May 26, 2022 in Python by Kichu
• 19,050 points
224 views
0 votes
0 answers

raw_input function in Python

What is the raw_input function? Is it ...READ MORE

Feb 17, 2022 in Python by surbhi
• 3,810 points
224 views
0 votes
0 answers

Touch event action using marionette_driver

HI, I am using marionette_driver to automate firefox ...READ MORE

Oct 13, 2021 in Python by anonymous
• 120 points
224 views
0 votes
0 answers

How does super() operate in the presence of multiple inheritance? As an example, consider the following:

class First(object): def __init__(self): ...READ MORE

Sep 6, 2023 in Python by Satyawrat
• 460 points
222 views
0 votes
0 answers

Replacements for switch statement in Python?

I want to write a function in ...READ MORE

Apr 22, 2022 in Python by Edureka
• 13,620 points
222 views
0 votes
0 answers

IndentationError: expected an indented block in phyton

Hi I i keep getting that error ...READ MORE

Sep 30, 2021 in Python by anonymous
• 120 points
222 views
0 votes
0 answers

How to define a two-dimensional array?

The following is how I want to d ...READ MORE

Nov 17, 2022 in Python by Ashwini
• 5,430 points
221 views
0 votes
0 answers

How do I reverse a list or loop over it backwards?

How can I perform a Python reverse ...READ MORE

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

How to use the pass statement

What would be a simple/basic situation where ...READ MORE

Apr 19, 2022 in Python by Edureka
• 13,620 points
215 views
0 votes
0 answers

How can I "count from the back" in python lists?

Say I have a list l = ['P','y','t','h','o','n'] I ...READ MORE

Nov 22, 2022 in Python by sarit
• 1,830 points
211 views
0 votes
0 answers

In Python, what does a "r" mean before a string?

In Python, what does a "r" mean ...READ MORE

Nov 17, 2022 in Python by Samuel
• 460 points
211 views