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
463 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
584 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,770 points
19,605 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
551 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
865 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
609 views
0 votes
1 answer
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
658 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
575 views
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
672 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
583 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
739 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
463 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 4 days ago 21,581 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,770 points
19,553 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 5 days ago 5 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 5 days ago 5 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
23,674 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
457 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 4 days ago 8,498 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,840 points
26,775 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
455 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 4 days ago 4,642 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 5 days ago 16 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 5 days ago 9 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,559 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
21,937 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 5 days ago 10 views
0 votes
0 answers

please tell what to do

READ MORE

Jan 28, 2022 in Python by anonymous
• 120 points

edited 5 days ago 10 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 5 days ago 14 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,917 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 5 days ago 9 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 5 days ago 14 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,872 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 5 days ago 9 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 5 days ago 9 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,186 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 4 days ago 3,364 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,711 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,750 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
685 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,235 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,840 points
23,583 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 4 days ago 9,982 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
785 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 5 days ago 16 views