Trending questions in Python

0 votes
0 answers

Use and meaning of "in" in an if statement?

In an example from Zed Shaw's Learn Python ...READ MORE

Apr 22, 2022 in Python by Edureka
• 13,680 points
660 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,680 points
704 views
+1 vote
8 answers

Count the frequency of an item in a python list

To count the number of appearances: from collections ...READ MORE

Oct 18, 2018 in Python by tinitales
36,770 views
0 votes
0 answers

Does Python have a ternary conditional operator?

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

Apr 19, 2022 in Python by Edureka
• 13,680 points
639 views
0 votes
0 answers

'python' is not recognized as an internal or external command

So I have recently installed Python Version ...READ MORE

Apr 18, 2022 in Python by Edureka
• 13,680 points
856 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,040 points
586 views
0 votes
0 answers

How can I take a message or command as user input to run a Python code

Is there any way where we can ...READ MORE

May 4, 2022 in Python by Sumana

edited Mar 4 147 views
0 votes
0 answers

Static methods in Python?

Is it possible to have static methods ...READ MORE

May 2, 2022 in Python by Edureka
• 13,680 points

edited Mar 4 199 views
0 votes
0 answers

What does end=' ' exactly do?

So, I'm struggling trying to understand this ...READ MORE

May 2, 2022 in Python by Edureka
• 13,680 points

edited Mar 4 199 views
0 votes
0 answers

Unable to install pandas for python

I am trying to install pandas for ...READ MORE

May 2, 2022 in Python by Edureka
• 12,710 points

edited Mar 4 198 views
0 votes
0 answers

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

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

May 2, 2022 in Python by Edureka
• 13,680 points

edited Mar 4 195 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,040 points
473 views
0 votes
0 answers

Generate random integers between 0 and 9

How can I generate random integers between ...READ MORE

May 2, 2022 in Python by Edureka
• 12,710 points

edited Mar 4 185 views
0 votes
0 answers

Python: % operator in print() statement

I just came across this Python code, ...READ MORE

Apr 18, 2022 in Python by Edureka
• 13,680 points
790 views
0 votes
0 answers

Removing duplicates in lists

How do I get a new list ...READ MORE

May 2, 2022 in Python by Edureka
• 12,710 points

edited Mar 4 182 views
0 votes
0 answers

Remove 'b' character do in front of a string literal in Python 3

I am new in python programming and ...READ MORE

May 2, 2022 in Python by Edureka
• 13,680 points

edited Mar 4 182 views
0 votes
0 answers

How do I count the occurrences of a list item?

Given an item, how do I count ...READ MORE

May 2, 2022 in Python by Edureka
• 13,680 points

edited Mar 4 174 views
0 votes
0 answers

How to calculate a mod b in Python?

Is there a modulo function in the ...READ MORE

May 2, 2022 in Python by Edureka
• 13,680 points

edited Mar 4 156 views
0 votes
0 answers

Is there a "not equal" operator in Python?

How would you say does not equal? Like if ...READ MORE

May 2, 2022 in Python by Edureka
• 13,680 points

edited Mar 4 148 views
0 votes
1 answer

How to do a not equal in Django queryset filtering?

Hello @kartik, Your query appears to have a ...READ MORE

Jun 26, 2020 in Python by Niroj
• 82,800 points
29,244 views
0 votes
0 answers

Is it possible to decorate classes?

Apr 24, 2022 in Python by Kichu
• 19,040 points
464 views
0 votes
0 answers

Python functions within lists

So I inquired about utilising a function ...READ MORE

Apr 12, 2022 in Python by Edureka
• 12,710 points
638 views
0 votes
1 answer

Sum a list of numbers in Python

So you want (element 0 + element ...READ MORE

Feb 14, 2022 in Python by CoolCoder
• 4,420 points
3,332 views
0 votes
1 answer

Exception in Tkinter callback Traceback (most recent call last):

Hello, @R, As per the Beautiful Soup Documentation: AttributeError: 'NoneType' ...READ MORE

Dec 21, 2020 in Python by Gitika
• 65,730 points
21,386 views
–1 vote
2 answers

In Python, How do I read 2 CSV files, compare column 1 from both, and then write to a new file where the Column 1s match?

Hi @Mike. First, read both the csv ...READ MORE

Jul 24, 2019 in Python by Omkar
• 69,180 points
34,432 views
0 votes
1 answer

DataFrame constructor not properly called! error

You are providing a string representation of ...READ MORE

Feb 22, 2022 in Python by Aditya
• 7,680 points
2,839 views
0 votes
0 answers

Base language of Python

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

Apr 18, 2022 in Python by Edureka
• 13,680 points
478 views
0 votes
0 answers

I am trying to get the sum of my list in python. This is my code:

import csv file1 = "Root/20Cent.txt" rows = [] result = ...READ MORE

Apr 24, 2022 in Python by kat

edited Mar 4 112 views
0 votes
0 answers

How to convert list to string

How can I convert a list to ...READ MORE

Apr 22, 2022 in Python by Edureka
• 13,680 points

reshown Mar 4 by Edureka 131 views
0 votes
0 answers

Converting Hex to RGB value in Python

How can one prompt the user to ...READ MORE

Apr 18, 2022 in Python by Edureka
• 13,680 points

edited Mar 4 141 views
0 votes
0 answers

Reverse a string in Python

There is no built in reverse function ...READ MORE

Apr 18, 2022 in Python by Edureka
• 13,680 points

edited Mar 4 138 views
0 votes
0 answers

How to reverse a list?

How do I iterate over a list ...READ MORE

Apr 18, 2022 in Python by Edureka
• 13,680 points

edited Mar 4 125 views
0 votes
1 answer

modulenotfounderror: no module named 'cv2'

Firstly, please do run these following commands ...READ MORE

Feb 8, 2022 in Python by Soham
• 9,730 points
2,921 views
0 votes
0 answers
0 votes
1 answer

What is the output of the following python code snippet?

for i in range(0, 10, 2):     if ...READ MORE

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

Testcase getting failed

def test_upload_file(client, tmp_path, set_mock_decrypty):     """     ...READ MORE

Apr 14, 2022 in Python by anonymous

edited Mar 4 84 views
0 votes
0 answers

I am using same version of chrome webdriver and browser, but not able to open a particular url through selenium

I am using anaconda package to automate ...READ MORE

Apr 12, 2022 in Python by uma

edited Mar 4 133 views
0 votes
0 answers

How to convert [4.] to [1,0] (convert 1 number to 2 number )

I'm trying to separate 1 number to ...READ MORE

Apr 12, 2022 in Python by faroukbehl

edited Mar 4 131 views
+1 vote
2 answers

ModuleNotFoundError: No module named 'selenium'

i fix the problem after installing go ...READ MORE

Nov 18, 2020 in Python by ahmed
25,145 views
0 votes
1 answer

What is the difference between driver.close() and driver.quit()?

close- This method is used to close ...READ MORE

Aug 20, 2021 in Python by anonymous

edited Mar 5 28,806 views
0 votes
1 answer

Automatically create requirements.txt

You can use the following code to ...READ MORE

Feb 22, 2022 in Python by Aditya
• 7,680 points
1,940 views
0 votes
1 answer

TypeError: a bytes-like object is required, not 'str' when writing to a file in Python3

After what I observed, you would have ...READ MORE

Feb 11, 2022 in Python by Rahul
• 9,690 points
2,301 views
0 votes
1 answer

Sum a list of numbers in Python

Let us take a list of Numbers ...READ MORE

Feb 14, 2022 in Python by Nandini
• 5,480 points
2,122 views
0 votes
1 answer

What is the difference between tree depth and height?

To answer your question, you will have ...READ MORE

Feb 9, 2022 in Python by Rahul
• 9,690 points
2,233 views
0 votes
1 answer

'pip' is not recognized as an internal or external command, operable program or batch file.

You will have to add the path ...READ MORE

Feb 8, 2022 in Python by Soham
• 9,730 points
2,258 views
0 votes
1 answer

'str' object does not support item assignment

In Python, strings are not very mutable ...READ MORE

Feb 22, 2022 in Python by Aditya
• 7,680 points
1,628 views
0 votes
0 answers

How to render Json Request and Html tempelate both from one flask Api

@adm.route('/list_users', methods=['GET']) @login_required @admin_permission.require(http_exception=403) def list_users():     try:         if (request.content_type.startswith('application/json')):         def processjsonlist():         @csrf.exempt           try:              page = request.args.get('page', ...READ MORE

Mar 29, 2022 in Python by Aryan
• 190 points

edited Mar 4 121 views
0 votes
0 answers

ImportError: cannot import name 'employees' from 'rest_framework'

from django.db import models # Create your models ...READ MORE

Mar 29, 2022 in Python by Rajni

edited Mar 4 105 views
0 votes
1 answer

Calculating arithmetic mean (one type of average) in Python

There are ways to calculate mean in ...READ MORE

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

How to scrape time-series chart data from poocoin.app with Python?

In order to ensure it works, one ...READ MORE

Feb 8, 2022 in Python by Rahul
• 9,690 points
1,927 views