Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 41 for say_hi (0.2 seconds)

  1. docs/ko/docs/advanced/advanced-python-types.md

    ```python
    from typing import Optional
    
    
    def say_hi(name: Optional[str]):
        print(f"Hey {name}!")
    ```
    
    매개변수 `name`은 `Optional[str]`로 정의되어 있지만, 사실 선택적이지 않습니다. 이 매개변수 없이 함수를 호출할 수 없습니다:
    
    ```Python
    say_hi()  # 이런, 에러가 발생합니다! 😱
    ```
    
    `name` 매개변수는 기본값이 없기 때문에 여전히 필수입니다(선택적이 아님). 대신, `name`에는 `None`을 전달할 수 있습니다:
    
    ```Python
    say_hi(name=None)  # 작동합니다. None은 유효합니다 🎉
    ```
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Feb 14 08:57:01 GMT 2026
    - 2.4K bytes
    - Click Count (0)
  2. docs/zh/docs/advanced/advanced-python-types.md

    举个例子,看这段函数:
    
    ```python
    from typing import Optional
    
    
    def say_hi(name: Optional[str]):
        print(f"Hey {name}!")
    ```
    
    参数 `name` 被定义为 `Optional[str]`,但它并不是“可选”的,你不能不传这个参数就调用函数:
    
    ```Python
    say_hi()  # 哎呀,这会报错!😱
    ```
    
    参数 `name` 仍然是必填的(不是“可选”),因为它没有默认值。不过,`name` 接受 `None` 作为取值:
    
    ```Python
    say_hi(name=None)  # 这样可以,None 是有效的 🎉
    ```
    
    好消息是,在大多数情况下,你可以直接使用 `|` 来定义类型联合:
    
    ```python
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Feb 13 13:37:57 GMT 2026
    - 2K bytes
    - Click Count (0)
  3. docs/ko/docs/advanced/settings.md

    예를 들어 다음 함수가 있다면:
    
    ```Python
    @lru_cache
    def say_hi(name: str, salutation: str = "Ms."):
        return f"Hello {salutation} {name}"
    ```
    
    프로그램은 다음과 같이 실행될 수 있습니다:
    
    ```mermaid
    sequenceDiagram
    
    participant code as Code
    participant function as say_hi()
    participant execute as Execute function
    
        rect rgba(0, 255, 0, .1)
            code ->> function: say_hi(name="Camila")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:06:26 GMT 2026
    - 11.9K bytes
    - Click Count (0)
  4. docs/ja/docs/advanced/advanced-python-types.md

    例として次の関数を見てみましょう:
    
    ```python
    from typing import Optional
    
    
    def say_hi(name: Optional[str]):
        print(f"Hey {name}!")
    ```
    
    パラメータ `name` は `Optional[str]` と定義されていますが、任意ではありません。このパラメータなしで関数を呼び出すことはできません:
    
    ```Python
    say_hi()  # あっ、これはエラーになります!😱
    ```
    
    `name` パラメータにはデフォルト値がないため、依然として必須(任意ではない)です。ただし、`name` は値として `None` を受け付けます:
    
    ```Python
    say_hi(name=None)  # これは動作します。None は有効です 🎉
    ```
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Feb 13 15:24:30 GMT 2026
    - 2.4K bytes
    - Click Count (0)
  5. docs/zh-hant/docs/advanced/settings.md

    例如,如果你有一個函式:
    
    ```Python
    @lru_cache
    def say_hi(name: str, salutation: str = "Ms."):
        return f"Hello {salutation} {name}"
    ```
    
    你的程式可能會這樣執行:
    
    ```mermaid
    sequenceDiagram
    
    participant code as Code
    participant function as say_hi()
    participant execute as Execute function
    
        rect rgba(0, 255, 0, .1)
            code ->> function: say_hi(name="Camila")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:05:38 GMT 2026
    - 10.3K bytes
    - Click Count (0)
  6. docs/en/docs/advanced/advanced-python-types.md

    As an example, let's take this function:
    
    ```python
    from typing import Optional
    
    
    def say_hi(name: Optional[str]):
        print(f"Hey {name}!")
    ```
    
    The parameter `name` is defined as `Optional[str]`, but it is **not optional**, you cannot call the function without the parameter:
    
    ```Python
    say_hi()  # Oh, no, this throws an error! 😱
    ```
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 11 18:32:12 GMT 2026
    - 2K bytes
    - Click Count (0)
  7. docs/zh-hant/docs/advanced/advanced-python-types.md

    from typing import Optional
    
    
    def say_hi(name: Optional[str]):
        print(f"Hey {name}!")
    ```
    
    參數 `name` 被標註為 `Optional[str]`,但它並不是可選的;你不能在沒有該參數的情況下呼叫這個函式:
    
    ```Python
    say_hi()  # 糟了,這會拋出錯誤!😱
    ```
    
    參數 `name` 仍是必填(不是可選),因為它沒有預設值。不過,`name` 可以接受 `None` 作為值:
    
    ```Python
    say_hi(name=None)  # 這可行,None 是有效的 🎉
    ```
    
    好消息是,多數情況下你可以直接用 `|` 來定義型別聯集:
    
    ```python
    def say_hi(name: str | None):
        print(f"Hey {name}!")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Feb 14 08:15:26 GMT 2026
    - 1.9K bytes
    - Click Count (0)
  8. docs/en/docs/advanced/settings.md

    ```Python
    @lru_cache
    def say_hi(name: str, salutation: str = "Ms."):
        return f"Hello {salutation} {name}"
    ```
    
    your program could execute like this:
    
    ```mermaid
    sequenceDiagram
    
    participant code as Code
    participant function as say_hi()
    participant execute as Execute function
    
        rect rgba(0, 255, 0, .1)
            code ->> function: say_hi(name="Camila")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 05 18:13:19 GMT 2026
    - 10.9K bytes
    - Click Count (0)
  9. docs/ja/docs/advanced/settings.md

    たとえば、次のような関数があるとします:
    
    ```Python
    @lru_cache
    def say_hi(name: str, salutation: str = "Ms."):
        return f"Hello {salutation} {name}"
    ```
    
    プログラムは次のように実行されます:
    
    ```mermaid
    sequenceDiagram
    
    participant code as Code
    participant function as say_hi()
    participant execute as Execute function
    
        rect rgba(0, 255, 0, .1)
            code ->> function: say_hi(name="Camila")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 14:07:17 GMT 2026
    - 12.7K bytes
    - Click Count (0)
  10. docs/zh/docs/advanced/settings.md

    例如,如果你有一个函数:
    
    ```Python
    @lru_cache
    def say_hi(name: str, salutation: str = "Ms."):
        return f"Hello {salutation} {name}"
    ```
    
    你的程序可能会像这样执行:
    
    ```mermaid
    sequenceDiagram
    
    participant code as Code
    participant function as say_hi()
    participant execute as Execute function
    
        rect rgba(0, 255, 0, .1)
            code ->> function: say_hi(name="Camila")
            function ->> execute: 执行函数代码
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 10.4K bytes
    - Click Count (0)
Back to Top