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
• 920 points
18 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
• 920 points

Related Questions In Python

0 votes
2 answers

What is the python keyword “with” used for?

Please visit this site to know abt ...READ MORE

answered Aug 31, 2018 in Python by Somesh
34 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,160 points
50 views
0 votes
0 answers

What is the patterns package in python used for?

Can we print a half pyramid pattern ...READ MORE

Jun 25 in Python by Waseem
• 3,440 points
14 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,160 points
43 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 127 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
• 920 points
20 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
• 920 points

edited Mar 18 by Omkar 593 views