Trending questions in Python

0 votes
1 answer

How do I specify new lines on Python, when writing on files?

In Python \n is used for new ...READ MORE

Feb 14, 2022 in Python by Nandini
• 5,480 points
571 views
0 votes
1 answer

Difference between "while" loop and "do while" loop

The do while loop helps in executing ...READ MORE

Feb 8, 2022 in Python by Soham
• 9,730 points
816 views
0 votes
1 answer

How to reverse a list?

A  list in Python can be reversed ...READ MORE

Feb 11, 2022 in Python by Dev
• 6,000 points
692 views
0 votes
1 answer

When to use "while" or "for" in Python

Yes, there is a significant distinction between ...READ MORE

Feb 9, 2022 in Python by CoolCoder
• 4,420 points
768 views
0 votes
1 answer

Is there a label/goto in Python?

Since Python is a structured programming language, ...READ MORE

Feb 4, 2022 in Python by Nandini
• 5,480 points
988 views
0 votes
1 answer

Iterating over dictionaries using 'for' loops

Here in this example the key is ...READ MORE

Feb 11, 2022 in Python by Dev
• 6,000 points
644 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 9,254 views
0 votes
1 answer
0 votes
1 answer

How can I count the occurrences of a list item?

For Counting the occurrences there are many ...READ MORE

Feb 7, 2022 in Python by Nandini
• 5,480 points
802 views
0 votes
1 answer

How to merge multiple json objects into a single json object using python

You may do like this but it ...READ MORE

Nov 22, 2020 in Python by Gitika
• 65,730 points
19,847 views
0 votes
1 answer

What is the use of "assert" in Python?

The statement assert exists in almost every programming ...READ MORE

Feb 7, 2022 in Python by Nandini
• 5,480 points
758 views
0 votes
1 answer

How to convert list to string

To convert list to string in Python ...READ MORE

Feb 9, 2022 in Python by Dev
• 6,000 points
656 views
0 votes
1 answer

How to delete conda env permanently?

First you check conda enviorment from following ...READ MORE

Jan 22, 2021 in Python by Muhammad Tariq

edited Mar 5 21,746 views
0 votes
1 answer

How to import a folder in Jupyter Notebook?

Hi@akhtar, There is no simple way to import ...READ MORE

Aug 17, 2020 in Python by MD
• 95,460 points
24,012 views
0 votes
1 answer

Is there a way to create multiline comments in Python?

In Python, you can use '''  some ...READ MORE

Feb 7, 2022 in Python by Nandini
• 5,480 points
702 views
0 votes
1 answer

Base language of Python

Python is written in C, not completely ...READ MORE

Feb 3, 2022 in Python by Dev
• 6,000 points
856 views
0 votes
1 answer

When to use "while" or "for" in Python?

while and for are both flow control ...READ MORE

Feb 9, 2022 in Python by Nandini
• 5,480 points
581 views
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,800 points
27,434 views
0 votes
0 answers

Python doesn't see variables are equal

i=3 def pw(): global i ...READ MORE

Feb 17, 2022 in Python by anonymous

edited Mar 4 88 views
0 votes
0 answers

I am trying to change the size of Tkinter window with the following line

Self.root.geometry('730x620+0+0+0') But its shows error wn_geometry_t ...READ MORE

Feb 17, 2022 in Python by anonymous

edited Mar 4 93 views
0 votes
0 answers

testing test test

This is the most active category where ...READ MORE

Feb 4, 2022 in Python by anonymous
• 300 points
567 views
0 votes
1 answer

AssertionError: <class 'numpy.ndarray'>

try below error df.loc['2020-07-06']. READ MORE

Sep 2, 2022 in Python by Nitin Pednekar

edited Mar 5 4,849 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
554 views
+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
22,226 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,730 points
18,358 views
0 votes
0 answers

how to ignore zero values

time =int(input()) day = time // (24 * ...READ MORE

Jan 31, 2022 in Python by anonymous

edited Mar 4 125 views
0 votes
0 answers

AttributeError: 'str' object has no attribute 'click'

Hey guys. i need help! I have ...READ MORE

Nov 8, 2021 in Python by anonymous
• 120 points
3,708 views
0 votes
0 answers

IndentationError: expected an indented block

I keep getting this error irrespective of ...READ MORE

Jan 30, 2022 in Python by anonymous

edited Mar 4 99 views
0 votes
0 answers

please tell what to do

READ MORE

Jan 28, 2022 in Python by anonymous
• 120 points

edited Mar 4 75 views
0 votes
0 answers

why do we hide data to user in python

in data abstraction, oops concept READ MORE

Jan 28, 2022 in Python by AHMED

edited Mar 4 68 views
0 votes
0 answers

Is there any way to preserve the actual function, even after wrapping up with a decorator in python?

@dec_sub def sub(a, b): ...READ MORE

Jan 25, 2022 in Python by anonymous

edited Mar 4 121 views
0 votes
0 answers

I have written python function which would like to take args from user rather passing manually inside the code

Hi Team, I have written a python function ...READ MORE

Jan 23, 2022 in Python by Venkatesh

edited Mar 4 97 views
0 votes
0 answers

How to download fles from server site n django

how I set path of different folder ...READ MORE

Jan 21, 2022 in Python by ramsha

edited Mar 4 112 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
25,011 views
0 votes
0 answers

i'm getting error for this code please help.

data_val = X_scaler.fit_transform(df[['CentreLift_Max-Warning', 'CentreLift_Min-Warning', 'CentreLift_Max-tripping', 'CentreLift_Min-tripping', 'CentreLift_RmsMotorCurrent', ...READ MORE

Jan 16, 2022 in Python by Joshi

edited Mar 4 97 views
0 votes
0 answers

"Turtle object has no attribute 'onkey' " error

import turtle as t turtle2=t.Turtle() def example():      print ("this is ...READ MORE

Jan 13, 2022 in Python by Marios

edited Mar 4 89 views
0 votes
0 answers

I am trying to install pyknow but i get this error

could not find a version that  satisfies ...READ MORE

Mar 4, 2020 in Python by Maria
• 120 points
4,422 views
0 votes
0 answers
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,891 views
0 votes
1 answer

What are the different types of data types one can use in Python?

In Python a data type represents the ...READ MORE

Mar 9, 2024 in Python by anonymous

edited Mar 5 3,502 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
35,526 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,950 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
756 views
0 votes
1 answer

Error:Python NameError: name 'include' is not defined

from django.urls import include you can import it ...READ MORE

Feb 17, 2022 in Python by anonymous

edited Mar 5 10,494 views
0 votes
1 answer
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,800 points
23,845 views
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
923 views
0 votes
0 answers

Create first line code Django - What of Error of the IndentationError: expected an indented block?

import datetime from django.db import models from django.utils import ...READ MORE

Dec 10, 2021 in Python by Warlen

edited Mar 4 111 views