강의

멘토링

로드맵

BEST
Data Science

/

Data Analysis

[Renewal] Python Introduction and Web Crawling Basics Bootcamp [Python, Web, and Data Understanding Fundamentals] (Updated)

For those who want to learn data science, big data, and web crawling, (1) we summarize the most essential Python syntax in a short time, and (2) you'll become familiar with Python and crawling through practical crawling programming.

(4.9) 730 reviews

7,541 learners

Level Beginner

Course period Unlimited

  • funcoding
Python
Python
Web Crawling
Web Crawling
Python
Python
Web Crawling
Web Crawling

[Share] Sharing tips to help you develop your skills as a developer

Hello. I am Dave Lee, instructor of Janjaemi Coding.

Today, I thought it would be a good idea to share some tips on how to develop your skills as a developer, along with an interesting case.

The following question came up. It's interesting, but it seems like a question that makes you think about how a real developer would solve a situation like this.

-------------------

Exercise 38. Data Structures and Loops (List)

Remove negative data from the following list variable, create a list variable with only positive numbers, and print that variable.

num_list = [0, -11, 31, 22, -11, 33, -44, -55]

cord:

num_list = [0, -11, 31, 22, -11, 33, -44, -55]

for i in num_list:

if i < 0:

num_list.remove(i)

print(num_list)

Execution result: [0, 31, 22, 33, -55]

I wrote the code above to solve problem 38, but I don't understand why -55 remains, so I have a question!

-------------------

To find an answer to this question, I

1. I ran the above code first and understood the strange part.

2. I printed out all the variable values line by line to see which part of the code was abnormal at each step as follows.

First! - No problem.

num_list = [0, -11, 31, 22, -11, 33, -44, -55]

print (num_list)

Second! - No problem.

num_list = [0, -11, 31, 22, -11, 33, -44, -55]

print (num_list)

for index, item in enumerate(num_list):

print(index, num_list, item)

Third! - Ah, here's where the problem might be~

num_list = [0, -11, 31, 22, -11, 33, -44, -55]

print (num_list)

for index, item in enumerate(num_list):

print(index, num_list, item)

if item < 0:

num_list.remove(item)

Looking at the output results of each third line, the num_list list value changes dynamically within the loop.

When the last loop is executed, the length of num_list is 5, and the number of loops is 0 to 4, that is, 5 times.

I realized that the last value of num_list, -55, was not repeated and the loop ended as is.

A tip I would like to share is,

Developers are always faced with unexpected situations like this.

In my case, I use three tips to solve problems. After all, no one can solve my issues every time.

1. When the code doesn't work as I want , I narrow down the scope to the most obvious part or the very top.

Print out all the parts that you are suspicious of. If you still don't understand, print out the values of all variables used line by line .

Print it out .

This way, you can understand how variables change value and why the code is executed in the way it is.

2. If this doesn't work, put several search terms into Google and search .

Since people are all the same anyway, it is very rare that I am the only one with this issue. Other people have had similar issues,

Developers tend to share these parts though.

3. If that doesn't work, I'll search for my issue in English on Google .

If you are not a domestic developer, foreign developers may definitely experience similar issues.

If you do these three things every time you encounter an issue, you will become skilled, develop your own know-how, and get faster and faster.

You will be able to solve problems and understand more technologies .

I hope these tips help you too.

thank you

We will be back with a new lecture in May. We are working hard to prepare.

# Lecture List

Comment