코드 생로병사의 비밀
  • 코드 생로병사의 비밀
  • 시작하기
  • Amazon Q Business
    • Amazon Q Business 애플리케이션 설정
    • 데이터 소스 구성
      • 웹 크롤러 데이터 소스 커넥터 활용하기
      • 문서 업로드
      • Amazon S3 데이터 소스 커넥터 구성
    • 관리자 컨트롤 및 가드레일 구성
      • 글로벌 컨트롤 구성하기
      • 주제 수준 컨트롤 구성
  • Amazon Q Developer
    • Amazon Q Developer 애플리케이션 로그인
    • 프롬프트 유형
      • 함수명 프롬프트
      • 한 줄 주석
      • 한 줄 프롬프트
      • 여러 줄 주석
      • 여러 줄 프롬프트
      • 변수명 기준
      • 고려 사항
    • 알고리즘 생성
      • 버블 정렬
      • 합병 정렬
    • 정규표현식
      • 정규 표현식 - 이메일
      • 정규 표현식 - 휴대폰
      • 정규 표현식 - 커스텀 표현식
    • 클래스 생성
      • Folder 클래스
      • User 클래스
      • 객체 지향 프로그래밍(OOP): 다형성 & 상속
    • SQL
      • SQL - Users
      • SQL - E-commerce Schema
    • 가짜 데이터 생성
      • 가짜 데이터 - 주가
      • Faker 패키지를 활용한 가짜 유저
    • AWS 서비스
      • S3 서비스
      • DynamoDB 서비스
      • SQS 서비스
Powered by GitBook
On this page
  • 예시 #1
  • 문자열과 숫자
  • 예시 #2
  • 함수 테스트
  1. Amazon Q Developer
  2. 프롬프트 유형

여러 줄 주석

Amazon Q Developer는 사용자의 의도를 이해하고 여러 줄의 주석을 기반으로 제안을 제공합니다.


예시 #1

문자열과 숫자

일반적인 프롬프트

Given a list that contains some numbers and strings, 
format the list elements into a string in which the numbers are prepended with a "#" 
and check for strings and wrap in a double quote.

Python 프롬프트

prompt_eng.py 라는 이름의 파일을 생성하고, 다음의 코드를 작성합니다.

"""
Given a list that contains some numbers and strings, 
format the list elements into a string in which the numbers are prepended with a "#" 
and check for strings and wrap in a double quote.
"""
Amazon Q Developer 제안
def format_list(list_of_items):
    return [f'#{item}' if type(item) == int else f'"{item}"' for item in list_of_items]

예시 #2

함수 테스트

일반적인 프롬프트

Test the format_list function

Python 프롬프트

같은 파일에 다음의 코드를 작성합니다.

# Test the format_list function
Amazon Q Developer 제안
list_of_items = [1, 2, 3, "Hello", "World", "!"]
print(format_list(list_of_items))
Previous한 줄 프롬프트Next여러 줄 프롬프트

Last updated 11 months ago