python
-
알고리즘 필수. Stack/Queue/재귀/bfs/dfspython 2023. 11. 17. 15:28
1. Stack 삽입 append() 삭제 pop() 2. Queue from collections import deque queue = deque() queue.append(5) queue.popleft() queue.reverse() 3. Recursive Function def recursive_function(i): if i == 100: return recursive_function(i+1) recursive_function(1) 3-1. Recursive Function - Factorial def fac(i): while i>1: return (i*fac(i-1)) if i
-
Easy #1python 2021. 7. 11. 10:27
https://www.hackerrank.com/challenges/whats-your-name/problem# What's Your Name? | HackerRank Python string practice: Print your name in the console. www.hackerrank.com # Complete the 'print_full_name' function below. # # The function is expected to return a STRING. # The function accepts following parameters: # 1. STRING first # 2. STRING last # def print_full_name(first, last): return print("H..