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
546 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
483 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
288 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
442 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,739 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
822 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
334 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
333 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,304 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
254 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
614 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
594 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
381 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
319 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
324 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,769 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
419 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,128 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
261 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
865 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,596 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,392 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,278 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,589 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
268 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
251 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
371 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
611 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,457 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,262 views
0 votes
2 answers

Removing duplicates in lists

list(set(t + t2)) READ MORE

Feb 13, 2022 in Python by anonymous
537 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
496 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,385 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
452 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
301 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
418 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
337 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
244 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,127 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
315 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
722 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
482 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,765 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,213 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,598 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,024 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,321 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
362 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
273 views