728x90 파이썬예제4 [Python] 미국 회사 코딩 테스트 예제: Solve the Two-Sum Problem Using a Hash Map 포스트 난이도: HOO_Middle# Problem StatementGiven an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order.Example: Input: nums = [2, 7, 11, 15], target = 9 Output: [0, 1]Explanation: Because nums[0.. 2025. 1. 27. [Python Examples] if문 예제 코드(Example of if statement) if문 예제 코드(Example of if statement) 포스트 난이도: HOO_Intern [Notice] 포스트 난이도에 대한 설명 안녕하세요, HOOAI의 Henry입니다. Bro들의 질문에 대한 내용을 우선적으로 포스팅이 되다 보니 각각의 포스트에 대한 난이도가 달라서 난이도에 대한 부분을 작성하면 좋겠다는 의견을 들었습니다 whoishoo.tistory.com [해당 포스트는 기존 2020.2.3일 자 포스트를 업데이트한 포스트입니다.] # Example 1 print("Hello, I'm HOO.") num1 = 20 num2 = 25 if num1 >= num2: print("num1이 num2보다 큽니다.") 위의 if 문 예제 코드는 if문의 기본 특징을 확인할 수 있는 간단한 if.. 2022. 7. 30. [Python] Linked List example code #01 class Node: def __init__(self, datavalue=None): self.datavalue = datavalue self.nextvalue = None class LinkedList: def __init__(self): self.headvalue = None def listprint(self): printvalue = self.headvalue while printvalue is not None: print (printvalue.datavalue) printvalue = printvalue.nextvalue list = LinkedList() list.headvalue = Node("Howdi y'all.") l2 = Node("Welcome to HOOAI!") l3 = Node(.. 2020. 10. 2. [Python examples#01] 간단한 for loop 예제 코드 간단한 for loop 예제 코드 print('Who is HOO Programming') friends = ["James", "Meckysni", "Catie"] for x in friends: print(x) 예제 코드를 활용하는 방법!! 1. 예제 코드를 보고 직접 컴파일을 해보세요. 예제 코드를 보기만 해도 좋지만, 각 기능이 어떤 역할을 하며 어떻게 결과 값이 산출되는지 생각해보시면 프로그래밍 능력 향상에 도움이 됩니다. 2. 예제 코드에서 모르는 부분이 있다면 알려주세요. 현재 예제 코드에서는 일부러 Comments 부분을 달지 않았습니다. 코드를 보다가 이해가 되지 않거나 궁금한 부분은 따로 알려주시면 감사하겠습니다. 3. Flowcharts를 직접 그려보시고 알려주세요. Flowcharts.. 2020. 2. 3. 이전 1 다음 728x90