Trending questions in Python

+1 vote
3 answers

Python error "AttributeError: 'Turtle' object has no attribute 'Shape'"

Hey @Nagya, replace python.Shape("Square") with the following: python.shape("square") Python is case ...READ MORE

Jun 19, 2019 in Python by Faiza
21,682 views
0 votes
1 answer

How to uninstall a package installed with pip install --user?

Having tested this using Python 3.5 and ...READ MORE

Dec 4, 2020 in Python by Gitika
• 65,770 points
17,698 views
0 votes
1 answer

ImportError: No module named matplotlib.pyplot

Hi@akhtar, It seems you don't have matplotlib library ...READ MORE

Jun 22, 2020 in Python by MD
• 95,460 points
24,786 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
20,556 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
643 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
2,469 views
+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
34,952 views
0 votes
0 answers
0 votes
1 answer
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
634 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,840 points
23,393 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,086 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
415 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
14,157 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,460 points
13,723 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
1,226 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
615 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,296 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
656 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,460 points
21,474 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
832 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,840 points
23,271 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
391 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,460 points
24,386 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,770 points
14,582 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
409 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,460 points
16,904 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
490 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
463 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
34,632 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
12,377 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
373 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,871 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
38,774 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,840 points
17,900 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,840 points
21,450 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
30,856 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
10,861 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,460 points
13,747 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,460 points
32,754 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,840 points
16,694 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,770 points
13,732 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,460 points
21,217 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,480 points
19,769 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
13,620 views
0 votes
1 answer

UnicodeDecodeError: "utf-8" codec can"t decode byte 0xeb in position 8: unexpected end of data

To read this dataset use encoding as ...READ MORE

Jul 15, 2019 in Python by Rishi
33,058 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,840 points
17,747 views
0 votes
1 answer

Error:Django TemplateSyntaxError - 'staticfiles' is not a registered tag library

Hello @kartik, Try {% load static %} instead of {% load ...READ MORE

Jul 29, 2020 in Python by Niroj
• 82,840 points
16,316 views