Appunti VERIFICATO

It coding 25-26

Cattolica del Sacro Cuore innovation and technology management Curriculum entrepreneurship 2025
Nessun voto ancora
Condividi: WhatsApp Telegram
Anteprima pagina 1 — It coding 25-26 Anteprima pagina 2 — It coding 25-26

Di cosa parla

  • Iterative primitives (loops) in Python include while and for loops; while loop executes code as long as a condition is true, for loop iterates over sequences.
  • Key points about while loop: includes an "exit strategy" to avoid infinite loops, break keyword allows early termination based on conditions, while True loop runs indefinitely until broken by break.
  • Continue keyword skips current iteration and moves to the next one; for loop is used for known iterations or sequence traversal, simpler than while for predictable tasks.
  • Range function generates a sequence of numbers useful with for loops, len() returns string length, slicing extracts substrings using start:end syntax, strings are immutable in Python.
  • String methods like .upper(), .lower(), .strip() manipulate content without changing the original; in operator checks substring presence case-sensitively, comparison operators compare ASCII values.
  • List is an ordered, mutable sequence of elements (can be mixed types), supports operations like append, extend, remove, sort, and reverse; len() and sum() are useful for lists, join() and split() facilitate conversion between strings and lists.
  • Equality checks in Python: == checks semantic equality, is checks if two variables point to the same object in memory; list comprehensions provide concise ways to create new lists based on existing ones or conditions.

Altri appunti di IT CODING, TOOLS AND SECURITY

Condividi questi appunti

WhatsApp Telegram