본문 바로가기

코딩7

Downloading Files in Mac OS: The 'curl' Alternative to 'wget' / 맥에서 wget 대신 curl! Stuck in class without wget? No problem!In my basic algorithms class, I needed to download a text file for an assignment, but I hadn't installed wget. Luckily, there's a way to download files by URL without any extra software. Here's how to do it! 맥에서 wget이 정상 작동 하지 않아 당황하였는가? wget대신 curl을 활용하여 해결할 수 있다.curlYou can use this in your Mac terminal as follows:curl -O [URL] -o myfile.txt  If you have.. 2024. 5. 27.
How do I represent 'else: pass' in a ternary expression?/ 'else: pass'문 삼항연산식으로 쓰기 While learning about ternary expressions, I'm wondering how to represent an 'else: pass' statement within a ternary expression. 삼항 연산식을 공부하다, 'else: pass'문을 어떻게 삼항 연산식 내에서 표현할 수 있을지 궁금했다. for i in range(num,-1,-1): if i%2==0: print(i) else: pass Is it possible to rewrite this code for better readability using a ternary expression? In fact, within ternary expressions, 'else: pass' is equivalent t.. 2024. 3. 27.
Programming with "return": Getting Started with Python and C / 파이썬과 C에서의 "return" What is the return value in Python and C? I will explore this concept using both Python and C. C와 파이썬 각각에서 return이란 무엇일까? 오늘은 해당 개념에 대해 설명해보고자 한다. Basic function of the "return" The fundamental function of the 'return' statement is to return a value from a function. I will initially explain this concept using Python. return의 기본적인 기능은 값을 반환해주는(뱉어주는) 것이다. 먼저 파이썬을 이용해 설명해보겠다. i=0 def test(x): i=x*1.. 2024. 3. 18.
C Programming : Concept of Pointer (1) / C언어 포인터 개념의 기초 A pointer contains the memory address of another variable. It points to the memory address, which is why it's called a pointer. 포인터는 메모리 주소를 저장한다. 메모리 주소를 가리킨다(points to)고 생각하면 된다. #include int main() { int a=5; int *pointer; pointer =&a; printf("%p\n", &a); printf("%p\n", pointer); return 0; } OUTPUT 0x16af43168 0x16af43168 int *pointer; Use '*' to declare an integer pointer variable. *를 이용해 in.. 2024. 3. 17.