Trending questions in Python

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,620 points
770 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 6 days ago 77 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,620 points
533 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
492 views
0 votes
1 answer

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

if file need open on append? READ MORE

Mar 7, 2022 in Python by Yarik

edited 5 days ago 14,219 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
388 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,620 points

edited 6 days ago 123 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,620 points

edited 6 days ago 97 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,620 points
700 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
379 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,620 points

edited 6 days ago 94 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,620 points

edited 6 days ago 91 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,690 points

edited 6 days ago 86 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,690 points

edited 6 days ago 85 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,690 points

edited 6 days ago 85 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,620 points

edited 6 days ago 85 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,620 points

edited 6 days ago 82 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,620 points

edited 6 days ago 77 views
0 votes
0 answers

Is it possible to decorate classes?

Apr 24, 2022 in Python by Kichu
• 19,040 points
372 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,690 points
498 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,199 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,280 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,620 points
387 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,840 points
28,863 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,609 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 6 days ago 9 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,620 points

reshown 6 days ago by Edureka 17 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,770 points
20,904 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,620 points

edited 6 days ago 17 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,620 points

edited 6 days ago 15 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,620 points

edited 6 days ago 14 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,220 points
33,882 views
0 votes
0 answers

I want to unzip file from one folder to another folder in s3 using lambda function python.I have one code for this but in this code file are automatically repeated when we upload file

import json import boto3 from io import BytesIO import zipfile def ...READ MORE

Apr 15, 2022 in Python by anonymous

edited 6 days ago 8 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 6 days ago 8 views
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,688 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 6 days ago 17 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,710 points
2,700 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 6 days ago 18 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
24,833 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 5 days ago 28,561 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,805 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
1,976 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,680 points
2,094 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,710 points
2,102 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 6 days ago 11 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 6 days ago 12 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,478 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,680 points
1,983 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,263 views
0 votes
1 answer

ImportError: No module named pandas

 I just had the problem and I ...READ MORE

Feb 17, 2022 in Python by Aditya
• 7,680 points
1,399 views