Trending questions in Python

0 votes
1 answer

ValueError: malformed string when using ast.literal_eval

Hello Kartik, An updated version of the answer ...READ MORE

May 27, 2020 in Python by Niroj
• 82,880 points
25,031 views
0 votes
0 answers

MQTT Subscribe

Hello, this is my code where i ...READ MORE

Dec 9, 2021 in Python by Shri
• 120 points
450 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,910 points
16,593 views
0 votes
1 answer

Python Requests module - Import Error: No module named requests

Run with Python 3 from the command ...READ MORE

Sep 11, 2020 in Python by Malik Brahimi
19,885 views
0 votes
0 answers
0 votes
0 answers

Write a Splitted PDF Back to HDFS using Python Insecure Client

I have used the PdfFileReader to read ...READ MORE

Nov 25, 2021 in Python by Kannan
• 120 points
426 views
0 votes
0 answers

NameError: name 'Solution' is not defined ret = Solution().singleNumber(param_1) Line 30 in _driver (Solution.py) _driver() Line 41 in <module> (Solution.py)

def singleNumber(self, nums: List[int]) -> int:         nums_dict = ...READ MORE

Oct 22, 2021 in Python by anonymous
• 120 points
1,819 views
0 votes
1 answer

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Hello @kartik, Since different users might have different ...READ MORE

Jun 15, 2020 in Python by Niroj
• 82,880 points
22,904 views
0 votes
0 answers

Complete the function diff, do not modify the rest.

def diff(a,b):     # end function print(" *** ...READ MORE

Nov 22, 2021 in Python by anonymous
• 120 points
259 views
0 votes
1 answer
+4 votes
3 answers

Write a for loop that prints all elements of a list and their position in the list. a = [4,7,3,2,5,9]

Try using this question by list comprehension: a=[4,7,3,2,5,9] print([x for ...READ MORE

Dec 9, 2019 in Python by vinaykumar
• 200 points
33,849 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
35,239 views
0 votes
3 answers

Count the number occurrences of a character in a string

The string count() method returns the number of occurrences of ...READ MORE

Dec 28, 2020 in Python by Carlos
13,392 views
0 votes
0 answers

ModuleNotFoundError: No module named 'pyQt5'

from pyQt5.QtWidgets import * def window(): ...READ MORE

Oct 8, 2021 in Python by anonymous
• 120 points
892 views
0 votes
0 answers

Please help me to install speech recognition in VS code

I got this type of error ERROR: Could ...READ MORE

Oct 4, 2021 in Python by Edureka
• 120 points
1,030 views
0 votes
0 answers

Help, How can I fix this? TypeError: Getting error as __init__() got an unexpected keyword argument 'rotaion_range'.

datagen = ImageDataGenerator(zoom_range=0.2,rotaion_range=10,width_shift_range=0.1, height_shift_range=0.1,horizontal_flip=True, vertical_flip = False ...READ MORE

Oct 20, 2021 in Python by anonymous
• 120 points
330 views
0 votes
0 answers

DevOps Engineer which language prefir for better

why python language is most used language ...READ MORE

Oct 19, 2021 in Python by anonymous
• 120 points
349 views
0 votes
1 answer

How to delete conda env permanently?

Hi@akhtar, You can remove your Conda environment by ...READ MORE

Jun 22, 2020 in Python by MD
• 95,440 points
21,036 views
0 votes
0 answers

what is wrong here?print ('We have logged in as{0.user}'.format(client))

I need to ask where I got ...READ MORE

Oct 17, 2021 in Python by anonymous
• 120 points
234 views
0 votes
0 answers

Why do i get this error in tkinter - Python?

This is my code: from tkinter import * root ...READ MORE

Oct 10, 2021 in Python by LogizTV
• 120 points
503 views
0 votes
0 answers

Touch event action using marionette_driver

HI, I am using marionette_driver to automate firefox ...READ MORE

Oct 13, 2021 in Python by anonymous
• 120 points
213 views
0 votes
0 answers

Class Type in Python

I know that type() function is used ...READ MORE

Oct 7, 2021 in Python by Brijesh
• 120 points
354 views
0 votes
0 answers

i'm not able to install numpy,time packges in phy charm

Oct 8, 2021 in Python by Sampath
• 120 points
304 views
+1 vote
1 answer

tensorflow is installed but theres an error while importing

Hi@Christlan, This problem is related to version. Follow ...READ MORE

Dec 22, 2020 in Python by MD
• 95,440 points
12,714 views
0 votes
2 answers

TypeError: 'float' object cannot be interpreted as an integer

Hi@akhtar, The range function does not work with ...READ MORE

Jun 29, 2020 in Python by MD
• 95,440 points
16,345 views
0 votes
0 answers

IndentationError: expected an indented block in phyton

Hi I i keep getting that error ...READ MORE

Sep 30, 2021 in Python by anonymous
• 120 points
214 views
0 votes
1 answer

How to use multiprocessing pool.map with multiple arguments?

The answer to this is version- and ...READ MORE

Nov 19, 2020 in Python by Gitika
• 65,910 points
13,709 views
0 votes
2 answers

How do I check if a variable exists in python?

Python doesn’t have a specific function to ...READ MORE

Dec 28, 2020 in Python by Carlos
11,912 views
0 votes
1 answer

Input() error - NameError: name '…' is not defined

Hello @kartik, You should use raw_input if you are ...READ MORE

May 5, 2020 in Python by Niroj
• 82,880 points
22,157 views
0 votes
1 answer

How do I upgrade my pycharm from python 2.7 to python 3?

Install Python 3.7(latest version) from the following ...READ MORE

Aug 5, 2019 in Python by Varsha
33,782 views
0 votes
1 answer

I am trying to install PIL module But I end up with an error :

Hi@Nishant, You can use PILLOW instead of PIL. $ ...READ MORE

Apr 6, 2020 in Python by MD
• 95,440 points
22,958 views
0 votes
0 answers

How can I solve it? TypeError: unsupported operand type(s) for /: 'float' and 'list'

I am trying to calculate numerical integration ...READ MORE

Nov 17, 2020 in Python by asimsek
• 120 points
13,076 views
0 votes
1 answer

Error:NoReverseMatch at /my_url/ Reverse for 'my_url_name' with arguments '()' and keyword arguments '{}' not found. n pattern(s) tried: []

Hello @kartik, The NoReverseMatch error is saying that Django cannot ...READ MORE

Jul 30, 2020 in Python by Niroj
• 82,880 points
17,309 views
0 votes
1 answer

TypeError: list indices must be integers or slices, not str

Hi@akhtar, As we know that the index of ...READ MORE

Oct 15, 2020 in Python by MD
• 95,440 points
13,411 views
0 votes
1 answer

How to convert BeautifulSoup object to string?

You can do this by directly type ...READ MORE

Apr 4, 2019 in Python by Ashu
37,566 views
0 votes
1 answer

TypeError: 'AxesSubplot' object does not support indexing

Hello , If you plot multiple subplots, the plt.subplots() returns ...READ MORE

May 7, 2020 in Python by Niroj
• 82,880 points
20,218 views
0 votes
4 answers

Install Python3 on Mac

Prerequisites You will need a macOS computer with ...READ MORE

Dec 15, 2020 in Python by Roshni
• 10,520 points
19,372 views
0 votes
1 answer

How do I make a field readonly (or disabled) so that it cannot be edited in Django form?

Hello @kartik, Setting readonly on a widget only makes the ...READ MORE

Aug 6, 2020 in Python by Niroj
• 82,880 points
15,907 views
0 votes
3 answers

Python program to print occurrence of character in string

Try below code string = input("Enter a string: ...READ MORE

May 28, 2020 in Python by Anubhav
• 300 points
29,776 views
0 votes
1 answer

AttributeError: module 'numpy' has no attribute '__version__'

Hi@akhtar, To avoid this error you can use ...READ MORE

Apr 20, 2020 in Python by MD
• 95,440 points
20,441 views
0 votes
2 answers

NameError: name 'raw_input' is not defined

Hi, There may a problem with your python ...READ MORE

Jun 25, 2020 in Python by MD
• 95,440 points
31,807 views
0 votes
1 answer

How to check if list is ascending?

You can go through the example given:  # ...READ MORE

Oct 12, 2020 in Python by Gitika
• 65,910 points
12,786 views
0 votes
2 answers

How to add image file in html using python

Hi, I have implemented as below from robot.api import ...READ MORE

Feb 9, 2021 in Python by anonymous
9,688 views
0 votes
2 answers

How can I write a program to add two numbers using functions in python?

there is sum() function as a built ...READ MORE

Oct 25, 2020 in Python by anonymous
23,279 views
0 votes
1 answer

How to access a dictionary element in a Django template?

Hello @kartik, Use Dictionary Items: {% for key, value ...READ MORE

Jul 3, 2020 in Python by Niroj
• 82,880 points
16,763 views
0 votes
2 answers

How to call perl script in Python script?

If you just want to open a ...READ MORE

Oct 7, 2020 in Python by Reshma
12,512 views
0 votes
1 answer

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

Hi, @hala, Regarding your query, you can go ...READ MORE

Jun 29, 2020 in Python by Niroj
• 82,880 points
17,004 views
0 votes
1 answer

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

This error occurs because you are using ...READ MORE

Sep 9, 2020 in Python by Gitika
• 65,910 points
13,662 views