Latest questions in Python

0 votes
1 answer

Are Python sets mutable?

Python sets are data structures which are ...READ MORE

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

How can I capitalize the first letter of each word in a string?

By using  the .title() method of string ...READ MORE

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

Get a list of numbers as input from the user

value = [int(num) for num in input().split()] Output 1 ...READ MORE

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

raw_input function in Python

raw_input was used in Python 2 version ...READ MORE

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

Pytesseract : "TesseractNotFound Error: tesseract is not installed or it's not in your path", how do I fix this?

Based on my recent experience with this ...READ MORE

Feb 16, 2022 in Python by Soham
• 9,700 points
33,425 views
0 votes
1 answer

'python' is not recognized as an internal or external command

Use "py" instead of "python" from command ...READ MORE

Feb 16, 2022 in Python by CoolCoder
• 4,400 points
807 views
0 votes
1 answer

syntaxerror: "unexpected character after line continuation character in python" math

The division operator is /, not \ READ MORE

Feb 16, 2022 in Python by CoolCoder
• 4,400 points
320 views
0 votes
1 answer

Does Python have a string 'contains' substring method?

You can use in operator to access ...READ MORE

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

'python' is not recognized as an internal or external command

There are multiple ways you can use: 1)Use ...READ MORE

Feb 16, 2022 in Python by Nandini
• 5,480 points
15,227 views
0 votes
1 answer

Does "IndexError: list index out of range" when trying to access the N'th item mean that my list has less than N items?

IndexError occurs when the item you want ...READ MORE

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

syntaxerror: "unexpected character after line continuation character in python" math

There is a slight confusion as both ...READ MORE

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

Reverse a string in Python

>>> 'hello world'[::-1] 'dlrow olleh' This is extended slice syntax. It ...READ MORE

Feb 15, 2022 in Python by CoolCoder
• 4,400 points
588 views
0 votes
1 answer

How do I get the number of elements in a list

The len() function can be used with several different ...READ MORE

Feb 15, 2022 in Python by CoolCoder
• 4,400 points
373 views
0 votes
1 answer

Reverse a string in Python

To reverse a string in Python we ...READ MORE

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

How do I get the number of elements in a list

items = [] items.append("apple") items.append("orange") items.append("banana") len(items) #use the ...READ MORE

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

Sum a list of numbers in Python

So you want (element 0 + element ...READ MORE

Feb 14, 2022 in Python by CoolCoder
• 4,400 points
2,753 views
0 votes
1 answer

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

It is up to you to decide ...READ MORE

Feb 14, 2022 in Python by CoolCoder
• 4,400 points
402 views
0 votes
1 answer

Remove all special characters, punctuation and spaces from string

This can be done without regex: >>> string ...READ MORE

Feb 14, 2022 in Python by CoolCoder
• 4,400 points
1,120 views
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
258 views
0 votes
1 answer

How can I get list of values from dict?

Here is an example to get the ...READ MORE

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

Sum a list of numbers in Python

Let us take a list of Numbers ...READ MORE

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

What does "SyntaxError: Missing parentheses in call to 'print'" mean in Python?

This error is generated when one is ...READ MORE

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

'Conda' is not recognized as internal or external command

I was coming across the same issue ...READ MORE

Feb 11, 2022 in Python by Soham
• 9,700 points
27,143 views
0 votes
1 answer

TypeError: a bytes-like object is required, not 'str' when writing to a file in Python3

After what I observed, you would have ...READ MORE

Feb 11, 2022 in Python by Rahul
• 9,670 points
1,581 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
256 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
247 views
0 votes
1 answer

Converting integer to string in Python

In order to convert an object to string ...READ MORE

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

What exactly are iterator, iterable, and iteration?

Iteration is a process in which one ...READ MORE

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

"inconsistent use of tabs and spaces in indentation"

To answer your question, start with eliminating ...READ MORE

Feb 10, 2022 in Python by Rahul
• 9,670 points
1,454 views
0 votes
1 answer

Purpose of "%matplotlib inline"

The %matplotlib inline is nothing but a ...READ MORE

Feb 10, 2022 in Python by Rahul
• 9,670 points
1,247 views
0 votes
2 answers

Removing duplicates in lists

list(set(t + t2)) READ MORE

Feb 13, 2022 in Python by anonymous
528 views
0 votes
1 answer

Removing duplicates in lists

To remove duplicates from List use, set ...READ MORE

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

What is the difference between tree depth and height?

To answer your question, you will have ...READ MORE

Feb 9, 2022 in Python by Rahul
• 9,670 points
1,365 views
0 votes
1 answer
0 votes
1 answer

What is the difference between Python's list methods append and extend?

Python's list methods append and extend add ...READ MORE

Feb 9, 2022 in Python by Nandini
• 5,480 points
446 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,400 points
293 views
0 votes
1 answer

What is the python keyword "with" used for?

It's useful when you have two or ...READ MORE

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

How can I add new keys to a dictionary in Python?

Yes, it is possible to add new ...READ MORE

Feb 9, 2022 in Python by Nandini
• 5,480 points
323 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
237 views
0 votes
1 answer

What is the output of the following python code snippet?

for i in range(0, 10, 2):     if ...READ MORE

Feb 9, 2022 in Python by Nandini
• 5,480 points
2,113 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
309 views
0 votes
1 answer

What is the difference between sets and lists in Python?

Lists can contain duplicates but sets cannot Sets ...READ MORE

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

What is the full form of oops?

To answer your doubt, the programming paradigm ...READ MORE

Feb 8, 2022 in Python by Soham
• 9,700 points
12,741 views
0 votes
1 answer

modulenotfounderror: no module named 'cv2'

Firstly, please do run these following commands ...READ MORE

Feb 8, 2022 in Python by Soham
• 9,700 points
2,198 views
0 votes
1 answer

'pip' is not recognized as an internal or external command, operable program or batch file.

You will have to add the path ...READ MORE

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

invalid literal for int() with base 10

In order to solve this problem, one ...READ MORE

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

How to scrape time-series chart data from poocoin.app with Python?

In order to ensure it works, one ...READ MORE

Feb 8, 2022 in Python by Rahul
• 9,670 points
1,313 views
0 votes
1 answer

What is the python keyword "with" used for?

The PEP343 documentation contains details regarding the ...READ MORE

Feb 9, 2022 in Python by Dev
• 6,000 points
350 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
263 views