ChatGPT를 디버깅, 코드 생성, 서식 변경, 주석 달기 등에 사용할 수 있습니다! 또한 40개 이상의 프로그래밍 언어로 된 코드를 사용할 수 있고요 😝

아주 오래된것 부터 최첨단까지의 표를 순서대로 나열해봤습니다!

Very Old Old Recent Bleeding Edge
BASIC Perl Swift Kotlin
Assembly Pascal TypeScript Julia
Fortran PHP Rust Crystal
Lisp Prolog Kotlin/Native Racket
COBOL C Julia (GPU) Lua
Algol PL/I Go Zig
SNOBOL C++ Dart Nim
RPG Smalltalk Elixir Crystal (LLVM)
Forth Tcl Groovy Vlang
Ada SQL Scala Native Erlang

#챗GPT에게 코드를 생성하도록 지시하는 방법!

Prompte ↓

Act as a junior python programmer. Please write the code to generate madlibs from 3 arrays of 6 items each: prepositions, verbs and nouns, with the nouns also being used as direct objects. After writing it, execute the code.

Output ↓

import random prepositions = ['at', 'in', 'on', 'with', 'under', 'over'] verbs = ['run', 'jump', 'dance', 'sing', 'laugh', 'cry'] nouns = ['cat', 'dog', 'tree', 'flower', 'book', 'computer'] preposition = random.choice(prepositions) verb = random.choice(verbs) noun = random.choice(nouns) madlib = f"I {verb} {preposition} the {noun}." print(madlib)

#코드 주석 달기 및 형식 재지정하는 방법!

ChatGPT에게 코드에 주석을 추가하고 가독성을 위해 형식을 다시 지정하도록 요청할 수 있습니다. 지금부터 프롬프트 지시 후 3개의 해시마크를 추가한 다음 정리할 코드를 붙여넣어보겠습니다!

Prompte ↓

Please add line comments to this Python code and reformat it for legibility: import math amplitude = 30 frequency = 2 num_points = 50 for i in range(num_points): y = int(round(amplitude * math.sin(2 * math.pi * frequency * i / num_points))) print(' ' * (amplitude + y) + '*')

Output ↓