Latest questions in Python

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
190 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
197 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 in Python by Ali
288 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
207 views
0 votes
1 answer

Command python execinterminal icon not found

When the "command Python execInTerminal" icon or ...READ MORE

Nov 29, 2023 in Python by anonymous
• 3,320 points
641 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,320 points
698 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,320 points
471 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
296 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
• 200 points
353 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
228 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
142 views
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
100 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
306 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
86 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
112 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
193 views
0 votes
0 answers
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
211 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
112 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
94 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
101 views
0 votes
0 answers
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
106 views
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
114 views
0 votes
1 answer

Replacements for switch statement in Python?

To get the same function as a ...READ MORE

Feb 16, 2023 in Python by Rishu
• 300 points
883 views
0 votes
0 answers

Function for factorial in Python

How can I compute an integer's factorial ...READ MORE

Feb 15, 2023 in Python by Arya
• 990 points
524 views
0 votes
1 answer

Removing duplicates in lists

1)To get rid of duplicate items, convert ...READ MORE

Feb 16, 2023 in Python by Rishu
• 300 points
693 views
0 votes
1 answer

Relative imports in Python 3

Because the first statement, from.mymodule import myfunction, ...READ MORE

Feb 16, 2023 in Python by Rishu
• 300 points
714 views
0 votes
1 answer

Error: 'int' object is not subscriptable - Python

int([x[age1]]) You are attempting to access the age1 index ...READ MORE

Feb 16, 2023 in Python by Rishu
• 300 points
685 views
0 votes
1 answer

Why is `(True, True, True) == True, True, True` not True in Python?

Operator precedence. You're actually checking equality between (True, ...READ MORE

Jan 4, 2023 in Python by Elton
• 400 points
472 views
0 votes
1 answer

What is the data type of (1) in python?

Typecasting is the process of converting one ...READ MORE

Jan 4, 2023 in Python by Elton
• 400 points
459 views
0 votes
1 answer

Python Math - TypeError: 'NoneType' object is not subscriptable

“TypeError: 'NoneType' object is not subscriptable” is ...READ MORE

Jan 4, 2023 in Python by Elton
• 400 points
768 views
0 votes
1 answer

How do I use method overloading in Python?

It's method overloading, not method overriding. And in Python, ...READ MORE

Jan 4, 2023 in Python by Elton
• 400 points
297 views
0 votes
1 answer

Python vs Cpython

So what is CPython? CPython is the original Python implementation. ...READ MORE

Jan 4, 2023 in Python by Elton
• 400 points
469 views
0 votes
0 answers

What should I do with "Unexpected indent" in Python?

How do I rectify the error "unexpected ...READ MORE

Dec 22, 2022 in Python by erzan
• 630 points
322 views
0 votes
0 answers

python: SyntaxError: EOL while scanning string literal

I have the above-mentioned error in s1="some ...READ MORE

Dec 22, 2022 in Python by erzan
• 630 points
268 views
0 votes
0 answers

TypeError: not all arguments converted during string formatting python

The program is supposed to take in ...READ MORE

Dec 22, 2022 in Python by erzan
• 630 points
718 views
0 votes
0 answers

Python Key Error=0 - Can't find Dict error in code

basically I have been racking my brains ...READ MORE

Dec 22, 2022 in Python by erzan
• 630 points
304 views
0 votes
0 answers

Print without space in python 3

I'm new to Python, and I'm wondering ...READ MORE

Dec 22, 2022 in Python by erzan
• 630 points
321 views
0 votes
0 answers

Python - TypeError: 'int' object is not iterable

Here's my code: import math print("Hey, lets solve Task ...READ MORE

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

What does the "yield" keyword do?

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

Dec 21, 2022 in Python by erzan
• 630 points
163 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
223 views
0 votes
0 answers

How do I update/upgrade pip itself from inside my virtual environment?

I'm able to update pip-managed packages, but ...READ MORE

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

What do these operators mean (** , ^ , %, //)? [

Other than the standard +, -, *and / operators; but what does ...READ MORE

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

Removing duplicates in lists

How can I check if a list ...READ MORE

Dec 20, 2022 in Python by erzan
• 630 points
185 views