Vai al contenuto principale
ProdottiStrumenti desktopTASTECADVisualizzazione disegniTASTEFILESGestione fileTASTEFTPTrasferimento fileTASTESSHSpazio di lavoro remotoTASTEZIPCompressione ed estrazioneStrumenti per sviluppatoriTASTECODEAmbiente di sviluppo integrato per RustTASTESTUDIOAmbiente integrato di sviluppo e testTASTEETLIntegrazione dati (ETL)ServerTASTEREMOTEServer di desktop remotoTASTEGEOServer geospazialeTASTEMAILSpazio di lavoro emailIniziaDownloadDocumentazioneAcquistaTutti i prodotti
Marketplace
Notizie
TecnologiaNotizieNotizie di sviluppo di oggiDocumentazioneLinguaggi di programmazioneRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartFramework frontend webNext.jsReactVue.js · NuxtSvelteKitAngularFramework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressFramework per app e desktopTauriFlutterReact NativeElectronAlgoritmiBasi degli algoritmiAlgoritmi fondamentaliAlgoritmi avanzatiAlgoritmi pratici
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrinaGuida alla community
CollaboraTrasferimento tecnicoRealizzazione del sito webRealizzazione di app desktopPipeline di rilascio e pagamentoPartner commercialeContatti
ServiziDesktop remotoPacchetti di installazione su misura
TASTEDEV
Prodotti

Strumenti desktop

TASTECADApri con leggerezza anche i disegni più complessiTASTEFILESSolo i file che servono, alla massima velocitàTASTEFTPLa via più ordinata per i tuoi fileTASTESSHUn legame più solido tra te e i tuoi serverTASTEZIPComprimi più veloce, estrai più sicuro

Strumenti per sviluppatori

TASTECODEModifica, compila, esegui il debug e testa app Rust in un'unica finestraTASTESTUDIODalla modifica ai test remoti e alle correzioni IA approvateTASTEETLSposta i dati guardando i valori

Server

TASTEREMOTEUn desktop remoto che gira sul tuo serverTASTEGEOUn server geospaziale compatibile con GeoServer, ricostruito in RustTASTEMAILRiprendi il controllo della tua posta

Inizia

DownloadUltime versioni di ogni prodottoDocsCome usare ogni prodottoAcquistaAbbonamenti e licenze perpetueTutti i prodottiTutti i prodotti a colpo d’occhio
Tutti i prodotti
MarketplaceNotizie
Tecnologia

Notizie

Notizie di sviluppo di oggiAnnunci ufficiali su linguaggi, framework, GitHub e IADocumentazioneGuide a linguaggi, framework e algoritmi

Linguaggi di programmazione

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Framework

Framework frontend webNext.jsReactVue.js · NuxtSvelteKitAngular
Framework serverSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
Framework per app e desktopTauriFlutterReact NativeElectron

Algoritmi

Basi degli algoritmiAnalisi della complessità · Ordinamento · Ricerca · Strutture dati di base · Alberi e heapAlgoritmi fondamentaliVisita dei grafi · Cammini minimi e alberi ricoprenti · Programmazione dinamica · Algoritmi greedy · Divide et impera · BacktrackingAlgoritmi avanzatiAlgoritmi sulle stringhe · Matematica e teoria dei numeri · Manipolazione dei bit · Alberi di segmenti · Union-FindAlgoritmi praticiStrategia per colloqui di programmazione · Cache LRU · Rate limiting · Hashing consistente
Tutta la documentazione di sviluppo
Community
ProgettiScopri sviluppatori e lavoriLog di sviluppoDecisioni e lezioni appresePromptIstruzioni riutilizzabiliProblemi degli strumenti di IAProblemi e alternative di Claude, Codex, GeminiVetrinaRisultati completatiGuida alla communityCome sviluppiamo in modo aperto
Collabora
Trasferimento tecnicoApp native in Rust ed eguiRealizzazione del sito web10 lingue, account, documentazione e downloadRealizzazione di app desktopRust ed egui, senza WebViewPipeline di rilascio e pagamentoFirma, MSI, deb, rpm, AppImage, hashPartner commercialeConsigliaci e ricevi il 30%ContattiSviluppo, partnership e investimenti
Servizi
Desktop remotoRaggiungi il tuo computer dal browserPacchetti di installazione su misuraSolo il necessario, impostazioni precaricate
Acquista
IT
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Accedi
Accedi
TASTEDEV

Dai piccoli strumenti a uno sviluppo migliore.

support@tastedev.netSostieni TASTEDEV
ProdottiGamma di prodottiAcquistaDocsDownloadMarketplaceAssistenza
CommunityProgettiLog di sviluppoPromptProblemi degli strumenti di IAVetrina
NormeInformativa sulla privacyTermini di servizioCondizioni di abbonamentoRimborsiLinee guida della community
AccountAccediRegistrati
Visitatori
Oggi
012345678901234567890123456789012345678901234567890123456789
Ieri
012345678901234567890123456789012345678901234567890123456789
Visualizzazioni totali
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
Società
GXSOFT
Rappresentante
CHOI YOUNG GU
Numero di registrazione
853-44-00368
Indirizzo
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Telefono
+82-10-4404-1523
E-mail
whitecalvin@tastedev.net
Responsabile privacy
CHOI YOUNG GU

© 2026 TASTEDEVLe informazioni sui prodotti si basano su fonti di sviluppo verificate.Rilasciato · in miglioramento

Documentazione di Python
Python
Getting StartedSyntax BasicsTypes and DataModules and PackagesErrors and TestingKey Concepts
Discussioni

Guida a Python · 2/6

Syntax Basics

Per ora questo capitolo è disponibile solo in inglese.

Python's syntax is famously compact, but a few of its rules surprise newcomers from brace-based languages. This chapter walks through variables, indentation, functions and their flexible argument handling, control flow, and f-strings, the everyday way to build text.

Variables and names

There is no declaration keyword: a variable comes into existence the first time you assign to it. Think of a variable as a label attached to a value. The value has a type; the label does not, so the same name can later point at something of a different type.

count = 3
name = "Python"
pi = 3.14159
is_ready = True

# assign several names at once, then swap them
x, y = 1, 2
x, y = y, x

# convention: snake_case for variables and functions, UPPER_CASE for constants
MAX_RETRIES = 5

Most projects follow the PEP 8 style guide: snake_case for functions and variables, PascalCase for classes, and UPPER_CASE for module-level constants.

Indentation is the block structure

Instead of braces, Python uses indentation. Statements that open a block, such as if, for, def and class, end with a colon, and every line indented beneath them at the same depth belongs to that block. Four spaces per level is the standard. Mixing tabs and spaces causes errors, so configure your editor to insert spaces. Comments start with #, and a triple-quoted string placed directly under a function or class becomes its docstring, which help() and editors display as documentation.

Functions

Define functions with def and hand back a result with return; a function that never returns explicitly gives back None. Parameters can have defaults, and callers may pass arguments by name, which makes call sites self-documenting.

def greet(name: str, greeting: str = "Hello") -> str:
    return f"{greeting}, {name}!"


greet("Mina")                      # 'Hello, Mina!'
greet("Mina", greeting="Hi")       # 'Hi, Mina!'
greet(greeting="Hey", name="Joon") # 'Hey, Joon!'

When a function should accept a variable number of arguments, use *args to collect extra positional arguments into a tuple and **kwargs to collect extra keyword arguments into a dict. A bare * in the parameter list makes everything after it keyword-only.

def log(message, *args, level="INFO", **kwargs):
    print(level, message, args, kwargs)


log("start", 1, 2, user="kim")
# INFO start (1, 2) {'user': 'kim'}


def connect(host, *, timeout=10):
    ...


connect("db.local", timeout=5)  # timeout can only be passed by name
Domande su questo capitolo?
Capitolo precedenteGetting StartedCapitolo successivoTypes and Data

One classic trap: default values are evaluated once, when the function is defined. Writing def add(item, items=[]) means every call shares the same list. Use None as the default and create a fresh list inside the function instead.

Control flow

Branching uses if, elif and else. Boolean operators are spelled out as words: and, or, not. There are two loops: while, and for, which walks over anything iterable, including lists, strings, dicts, files and ranges.

score = 82
if score >= 90:
    grade = "A"
elif score >= 80:
    grade = "B"
else:
    grade = "C"

for i in range(3):          # 0, 1, 2
    print(i)

fruits = ["apple", "banana"]
for index, fruit in enumerate(fruits):
    print(index, fruit)

n = 10
while n > 0:
    n -= 3
    if n == 4:
        continue
    print(n)

break leaves a loop early and continue skips to the next iteration. For a compact choice between two values there is the conditional expression, "even" if n % 2 == 0 else "odd". When you need to branch on the shape of a value, the match statement offers structural pattern matching.

f-strings

Prefix a string literal with f and you can embed variables and arbitrary expressions in braces. A format spec after a colon controls decimals, width, alignment and thousands separators, and a trailing = prints both the expression and its value, which is great for quick debugging.

name = "Mina"
price = 12345.678

print(f"Hi {name}, your total is ${price:,.2f}")  # 12,345.68
print(f"{name:>10}|")     # right-aligned in a field of 10
print(f"{len(name) * 2}") # any expression works
print(f"{price=}")        # price=12345.678

Summary

  • Variables are created by assignment; types belong to values, not names.
  • Blocks are marked by a colon and four-space indentation.
  • Functions support defaults, keyword arguments, *args and **kwargs; never use a mutable object as a default.
  • Use if/elif/else, for and while for control flow, and f-strings for building text.

0 commenti

Commenti principaliPrima i più recenti

Accedi · Accedi per lasciare un commento.