assert keyword in python is used for what purpose?

0 votes
While going thorugh a source code, I found that "assert" keyword is used alot.

I want to understand what assert keyword is used for?
May 24 in Python by Taj
• 1,040 points
51 views

1 answer to this question.

0 votes

The assert keyword is used while debugging code for smooth flow of code.

It enables you to test if a condition in your code is true, if not, then the program raise assertion error.

answered May 24 by Taj
• 1,040 points

Related Questions In Python

0 votes
3 answers

What is the python keyword “with” used for?

The with statement in Python simplifies exception ...READ MORE

answered Jul 19 in Python by rahul
• 200 points
57 views
0 votes
1 answer

What is the use of “assert” keyword in Python?

You can try the following in a ...READ MORE

answered Oct 15, 2018 in Python by Priyaj
• 56,520 points
69 views
0 votes
1 answer

What is the patterns package in python used for?

Pattern is a web mining tool in ...READ MORE

answered Jul 31 in Python by Mohammad
• 3,060 points
24 views
0 votes
1 answer

What is the flow control for “continue” in python?

This is the way "continue" statement works! You ...READ MORE

answered Jul 16, 2018 in Python by Priyaj
• 56,520 points
52 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 228 views
+4 votes
6 answers
0 votes
1 answer

.join() method is used for what purpose in Python?

join() method is used to concatenate or ...READ MORE

answered May 14 in Python by Taj
• 1,040 points
26 views
0 votes
1 answer

In Python, what is difference between Array and List?

Lists and arrays are used in Python ...READ MORE

answered Mar 15 in Python by Taj
• 1,040 points

edited Mar 18 by Omkar 2,864 views