Trending questions in Python

0 votes
3 answers

Python exit commands - why so many and when should each be used?

The functions* quit(), exit(), and sys.exit() function in the same way: ...READ MORE

Dec 14, 2020 in Python by Gitika
• 65,730 points
67,391 views
0 votes
2 answers

Do we have pointers in python like other programming languages?

From one point of view, everything is a pointer in Python. Your ...READ MORE

Dec 16, 2020 in Python by Gitika
• 65,730 points

edited Jul 8, 2021 by Sarfaraz 63,042 views
0 votes
1 answer

Sum of prime numbers from m to n in python

def is_prime(number):     if number < 2:         return False     for i ...READ MORE

Jan 5, 2024 in Python by Ali
1,460 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
1,039 views
0 votes
3 answers

AttributeError: 'numpy.ndarray' object has no attribute 'append'

for root, dirs, files in os.walk(directory): ...READ MORE

Dec 12, 2020 in Python by Rajiv
• 8,870 points
53,597 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
1,044 views
0 votes
1 answer

How to find an element in Pandas Dataframe?

You can do it like this: Suppose df is ...READ MORE

Apr 8, 2019 in Python by Tina
75,143 views
0 votes
1 answer

How to install Tensorflow in pycharm ?

For installing TensorFlow your system must be ...READ MORE

Jun 23, 2020 in Python by Varsha Kumari
55,367 views
+1 vote
4 answers

Python: convert txt file to csv format with rows and columns

Python will read data from a text ...READ MORE

Dec 14, 2020 in Python by Gitika
• 65,730 points
58,419 views
0 votes
1 answer

/usr/bin/env: ‘python’: No such file or directory

Hi@akhtar, It seems your python script is not ...READ MORE

Sep 20, 2020 in Python by MD
• 95,460 points
50,047 views
0 votes
1 answer

Why am I getting the syntax error SyntaxError invalid syntax in a line that contains fully valid syntax?

A "SyntaxError: invalid syntax" is a common ...READ MORE

Oct 18, 2023 in Python by anonymous
• 3,360 points
1,298 views
+1 vote
7 answers

What do you mean by python scripting? What is a script and a module in python?

A module is a file containing a ...READ MORE

Jun 17, 2019 in Python by Zain Abbas
66,085 views
0 votes
0 answers

Python shopping cart add to cart, get total get num items

I want to loop through the list ...READ MORE

Apr 25, 2022 in Python by Kichu
• 19,040 points
23,968 views
0 votes
1 answer

What do "init" and "self" do in python ?

In Python, `init` and `self` are related ...READ MORE

Oct 5, 2023 in Python by anonymous
• 3,360 points
1,167 views
0 votes
1 answer

Python urllib2 login to minecraft net

Why not use Selenium over urllib? Selenium ...READ MORE

Sep 25, 2023 in Python by Rajarshi
• 470 points
723 views
0 votes
0 answers

root = tk.TK() ERROR, i dont get why ???

import tkinter as tk from tkinter import ttk # ...READ MORE

Oct 3, 2023 in Python by anonymous

edited Mar 5 133 views
0 votes
0 answers

How do I install opencv using pip?

I need to install cv2 for a ...READ MORE

Sep 13, 2023 in Python by Rahul
• 240 points
964 views
0 votes
0 answers
0 votes
0 answers
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
616 views
0 votes
0 answers

I'm making a Python program to do math, figure out answers, and so on, but I'm getting the syntaxerror: "unexpected character after line continuation character in python."

This is my code: print("Length between sides: "+str((length*length)*2.6)+" ...READ MORE

Sep 7, 2023 in Python by Satyawrat
• 460 points
754 views
0 votes
0 answers
0 votes
0 answers

How to find the number of a list item ?

Given a list ["foo", "bar", "baz"] and ...READ MORE

Sep 11, 2023 in Python by Satyawrat
• 460 points
467 views
0 votes
0 answers

How to use the open with statement to open a file

I'm researching file input and output in ...READ MORE

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

What do the three different types of brackets in Python code mean? I'm not sure if this is right, so if I'm wrong, please tell me:

[] - Normally used for dictionaries, list items () - ...READ MORE

Sep 11, 2023 in Python by Satyawrat
• 460 points
436 views
0 votes
0 answers

What is print(f"...")

I'm looking at a Python script that ...READ MORE

Sep 18, 2023 in Python by Satyawrat
• 460 points

edited Mar 5 108 views
0 votes
0 answers
0 votes
0 answers

What is print(f"...") ?

I'm looking at a Python script that ...READ MORE

Sep 18, 2023 in Python by Satyawrat
• 460 points

edited Mar 5 87 views
0 votes
0 answers

I have a very long list of datetime strings like these:

["Jun 1 2005 1:33PM", "Aug 28 1999 ...READ MORE

Sep 7, 2023 in Python by Satyawrat
• 460 points
529 views
0 votes
0 answers

How to sort a dictionary using key?

Example input: {2:3, 1:89, 4:5, 3:0} Desired output: {1:89, 2:3, ...READ MORE

Sep 4, 2023 in Python by Satyawrat
• 460 points
606 views
0 votes
0 answers

What does %s in a Python format string mean?

For example, in the below code if len(sys.argv) ...READ MORE

Sep 5, 2023 in Python by Satyawrat
• 460 points
577 views
0 votes
0 answers

How do I use Python to change YOLO format comments to x1, y1, x2, y2 coordinates?

I want to know how to change ...READ MORE

Sep 16, 2023 in Python by Satyawrat
• 460 points

edited Mar 5 94 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
457 views
0 votes
0 answers

Is it okay for general applications to use the RuntimeError exception?

raise RuntimeError('config file is missing host address') I've ...READ MORE

Sep 7, 2023 in Python by Satyawrat
• 460 points
373 views
0 votes
0 answers

What do the python file extensions, .pyc .pyd .pyo stand for?

What do these python file extensions mean? .pyc .pyd .pyo What ...READ MORE

Sep 12, 2023 in Python by Rahul
• 240 points

edited Mar 5 109 views
0 votes
0 answers

If I want to find the sum of a number's numbers, such as:

Input: 932 Output: 14, which is (9 + 3 + 2) What ...READ MORE

Sep 11, 2023 in Python by Satyawrat
• 460 points

edited Mar 5 112 views
0 votes
0 answers
0 votes
0 answers

Python urllib2 login to minecraft.net

I have a doubt. I'm creating a ...READ MORE

Aug 31, 2023 in Python by Edureka
• 220 points
541 views
0 votes
0 answers

What do __init__ and self do in Python? [duplicate]

During my Python lectures, I've come across a ...READ MORE

Aug 31, 2023 in Python by Edureka
• 220 points
467 views
0 votes
0 answers

How to sum the values of a JavaScript object?

I'd like to sum the values of ...READ MORE

Sep 1, 2023 in Python by Edureka
• 220 points
330 views
0 votes
2 answers

What's the difference between %s and %d in Python string formatting?

The reason is that they are using ...READ MORE

Feb 8, 2022 in Python by Rahul
• 9,690 points
24,528 views
0 votes
1 answer

KeyError: "['Place'] not found in axis"

I think you had click on run ...READ MORE

Mar 1, 2021 in Python by Bulky

edited Mar 5 42,059 views
0 votes
1 answer

What is the difference between read() and readline() in python?

The read() will read the whole file at ...READ MORE

Apr 28, 2022 in Python by narikkadan
• 86,360 points
18,020 views
+1 vote
2 answers

What is the difference between .py and .pyc files in Python?

Hi, @Roshni, You can follow a few steps ...READ MORE

Jun 23, 2020 in Python by Gitika
• 65,730 points
35,401 views
0 votes
3 answers

TypeError: Index(...) must be called with a collection of some kind, 'Email' was passed

It is not working because your code ...READ MORE

May 13, 2020 in Python by anonymous

edited May 13, 2020 by Gitika 56,927 views
0 votes
0 answers

I want something related to python.

#  Don't change the code below print("Welcome ...READ MORE

May 14, 2023 in Python by Krishna

edited Mar 5 135 views
0 votes
0 answers

# cmds.select(myPlane. vtx[*]) # ^ # IndentationError: unexpected indent #

#     cmds.select(myPlane. vtx[*]) #     ^ # IndentationError: unexpected indent ...READ MORE

Apr 26, 2023 in Python by anonymous

edited Mar 5 115 views