Skip to content

tobiasMs/Basic-Python

Repository files navigation

Basic-Python

Learn Basic Python about Looping, Break, Continue, And how to Handling Error


Use Case

Objective Statement :

  • Get the insight about For and While Looping in the Python
  • Get the insight about Break and Continue in the Python
  • To gain new knowledge about Pass
  • To gain new knowledge about the application of List Comprehension
  • Get the insight about Syntax Errors and Exceptions
  • Get the new insight about how to Handling Error in the Python

Challenges :

  • Python is a case sensitive programming language, so the writing of the syntax must be considered

Expected Outcome :

  • Knowing more about for and while looping in the Python and realize the difference syntax with other programming languages
  • Knowing more about break and continue
  • Knowing the function of pass in python
  • Knowing the application of list comprehension
  • Understanding syntax errors and exceptions in Python
  • Knowing how to handling error in the Python

Benefits :

  • As a basic material for learning Python language for beginners
  • As additional knowledge about looping, syntax errors and exceptions, handling error, and list comprehension in the Python

Outlines

For Looping

  • The for loop is used to iterate over a sequence such as a list, string, tuple, other iterable objects such as range.
  • A nesting loop means to loop over a sequence of sequences (a for loop inside another for a the loop).

While Looping

  • While loop is basically used to know how many iterations are required, can execute a set of statements as long as a certain condition is true.
  • When the condition becomes false, program control passes to the line immediately following the loop.

Break

  • The break statement is used to terminate (stop) the loop, when a condition is met.
  • Use the break keyword with if statement to stop and exit the loop.

Continue

  • The continue statement means skipping the current iteration of a loop and continuing (immediately jumps) with the next iteration.
  • Use the continue keyword to skip a block in a loop the current iteration.

Pass

  • The pass statement is used as a code block material, to fill an empty code block.
  • The pass used to be a statement or block of statements (statements), but did nothing to continue execution in order.

List Comprehension

  • List comprehensions are an easy way to define and create lists in Python.
  • List comprehension is very useful if the list members we want to create are quite a lot.

Syntax Errors

  • Syntax error is an error caused by not following the proper structure (syntax) of the language in Python.
  • Syntax errors usually occur when we are just starting to learn Python

Exceptions

  • Exception is the error that occur while the process is in progress
  • Exceptions will be fatal if not handled

Handling Error

  • Handling error to resolve the error so as not to stop the program
  • Many types and ways to solve errors

About

Learn Basic Python about Looping, Break, Continue, And how to Handling Error

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published