Trending questions in Python

0 votes
0 answers

Which version of Python do I have installed?

On a Windows server, I need to ...READ MORE

May 9, 2022 in Python by Edureka
• 13,750 points

edited Mar 4, 2025 320 views
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,750 points
916 views
0 votes
0 answers

Extracting extension from filename in Python

Is it possible to extract the extension ...READ MORE

May 9, 2022 in Python by Edureka
• 13,750 points

edited Mar 4, 2025 297 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,750 points
900 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,750 points
940 views
0 votes
0 answers

TypeError: 'int' object is not callable

gfdfghfhg READ MORE

May 8, 2022 in Python by Kichu
• 19,040 points

edited Mar 4, 2025 311 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,750 points
904 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
773 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
821 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,750 points
1,080 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,750 points

edited Mar 4, 2025 462 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,699 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,720 points

edited Mar 4, 2025 415 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, 2025 310 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,720 points
916 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,750 points
999 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,750 points

edited Mar 4, 2025 364 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,750 points

edited Mar 4, 2025 364 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,750 points

edited Mar 4, 2025 354 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,720 points

edited Mar 4, 2025 351 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,720 points

edited Mar 4, 2025 351 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
3,281 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,750 points

edited Mar 4, 2025 339 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,750 points

edited Mar 4, 2025 332 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,750 points

edited Mar 4, 2025 326 views
0 votes
0 answers

Is it possible to decorate classes?

Apr 24, 2022 in Python by Kichu
• 19,040 points
662 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,750 points
669 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, 2025 295 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,750 points

reshown Mar 4, 2025 by Edureka 344 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
3,425 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,735 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,750 points

edited Mar 4, 2025 412 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,750 points

edited Mar 4, 2025 355 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
3,220 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,750 points

edited Mar 4, 2025 310 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, 2025 29,306 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 Mar 4, 2025 286 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, 2025 307 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, 2025 329 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, 2025 324 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,854 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
2,292 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,790 views
0 votes
1 answer

Difference between python programing and scripting

Hi,@Sashi, Generally, all the scripting languages are considered ...READ MORE

Nov 27, 2020 in Python by Gitika
• 65,730 points
21,677 views
0 votes
1 answer

How to change the “tick frequency” on x or y axis in matplotlib?

You could explicitly set where you want ...READ MORE

Jan 5, 2021 in Python by Gitika
• 65,730 points
19,990 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,695 views
+1 vote
3 answers

While using pyttsx 3 , I am having the following ERROR, i have installed pypiwin32

I got the same error "module not ...READ MORE

Aug 2, 2022 in Python by anonymous

edited Mar 5, 2025 11,177 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,424 views
0 votes
2 answers

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte

Hey,  @Himanshu. It's still most likely gzipped data. ...READ MORE

Jul 27, 2020 in Python by Gitika
• 65,730 points
27,090 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,973 views