0% found this document useful (0 votes)
12 views7 pages

Coding Basics: Break Statements & Functions

The document discusses coding concepts such as the break statement, which allows exiting loops for better control, and functions, which are blocks of reusable code that accept arguments and may return values. It emphasizes the importance of modularity and organization in programming. Examples of both concepts are provided to illustrate their usage.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views7 pages

Coding Basics: Break Statements & Functions

The document discusses coding concepts such as the break statement, which allows exiting loops for better control, and functions, which are blocks of reusable code that accept arguments and may return values. It emphasizes the importance of modularity and organization in programming. Examples of both concepts are provided to illustrate their usage.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Coding & Data

Visualization

Dr. Zakaria El Hathat


Department of Supply Chain & Information Systems
Rabat Business School, International University of Rabat
Break statement
Allows us to go(break) out of a loop preliminary.
Adds a bit of controllability to a while loop.
Usually used with an if.
Can also be used in a for loop.
Break statement example
Functions
A function is a block of code that performs a specific task.
It helps make your program modular, organized, and reusable.
Functions
Functions accept arguments and execute a piece of code.
Often, they also return values.
Function example
Function example

You might also like