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,591 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,752 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,623 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,494 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
627 views
0 votes
0 answers
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,376 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,850 views
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
594 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,330 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,998 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
391 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,094 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,191 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,597 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,281 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
574 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
622 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,443 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
797 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
366 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,149 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
378 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,523 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,249 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,811 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
456 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
447 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,527 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,347 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
358 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,775 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,830 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,655 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,324 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,765 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,704 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,735 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,665 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,610 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,647 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,134 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,715 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,523 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,665 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
32,957 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,840 views