An introduction to Python for non-engineers

Follow the trends of the world ~ About programming ~

Recently, "programming" has been attracting attention so that you can understand it without saying it. Until a while ago (2010-2015), programming was something that science engineers worked on, and something that was unfamiliar to so-called non-science and mathematics people, such as those used by computer specialists. However, if you look around the world, IT companies such as GAFA are listed in the Top 10 World Market Capitalization Rankings. In both the United States and Asia, the impact of IT companies on society is increasing day by day. I don't think it's necessary to discuss the fact that companies with technology are strong. Then, if it is not necessary to have IT knowledge in manufacturers and trading companies other than IT-related companies, and companies that mainly focus on fields such as agriculture and logistics, that is not the case at all. Rather, if you want to survive, you absolutely must have knowledge of IT. </ b> Nearly 30 years ago, the Internet was certainly not widespread, and people's way of life was completely different, so it may have been good if experts were doing technical things. However, with the passage of time, mobile phones and the Internet have become widespread, and it has become a world where you can get all of your clothing, food, and shelter without leaving your house. Use your Android or Apple smartphone to search on Google, buy what you need for your life on Amazon, keep up with your friends on Facebook and Instagram, kill time on Youtube, or send yourself a follower You don't have to go out at all if you collect and send money with Paypal. </ b> Lifestyles have changed so much with the development of IT technology (although the above example is extreme), I think the reason why IT human resources are necessary is that they can contribute to the above lifestyles. Human resources with technology have high market value in the future and will continue to be needed. Then, what exactly is that technology is programming technology. Just remember that it's a skill that allows you to write code, assemble algorithms, implement your own programs, and have the potential to bring technological improvements and innovations to your business. By the way, there is a "Excel master" </ b> that is commonly referred to as being excellent in IT technology, but I think it is better not to recognize that Excel can be done = IT human resources. .. You can use it conveniently by combining functions and devising spreadsheets, but Excel alone has its limits. This was also an opportunity for me to learn Python, so I would be grateful if people with similar feelings would consider it as their own.

Why Python, not C or Java

Often, when starting programming, many people are wondering "Which language should I start with?" In fact, when I was able to use VBA all the way through and thought I had to learn another language because I still didn't have enough to do what I wanted to do, I was quite confused as to which language to choose. Ruby, PHP, Java, C (C ++), Perl ... Looking around the world, there are many programming languages, including legacy languages such as COBOL, BASIC, and FORTRAN. By the way, it is rumored that COBOL is still used in the blue bank among the mega banks that are often talked about, but in reality ... Anyway, it is no exaggeration to say that the language you choose will affect your programming life afterwards. Because it affects how you write, what you can do, and whether you like it or hate it intuitively, so in that sense it's a lot like being influenced by the lover you first met. If you go out with a weirdo, you will somehow like the weirdo, or you will somehow choose the same type as your ex-boyfriend and girlfriend.

Personally speaking, the first programming language I mentioned was Java, which I learned in an elective class at university, which was a very bad experience. This is because, whether or not the instructor knows this, the curriculum is followed, so questions such as "Why does this work?" Are not solved at all. It's like going somewhere in middle school or high school without knowing why the math formula is "why this happens". Thanks to that, I couldn't keep up with the lesson and abandoned the lesson, and if I couldn't understand the rudimentary things, programming wouldn't be suitable for me, and I had a bitter experience of closing my potential. is there. I don't want people reading this to have that kind of experience, so I recommend the language "Python". This site </ b> ranks programming languages based on the number of tutorials examined by Google, but here Python is the highest. The second is Java and the third is Javascript, but I feel that it is certainly such a thing. Also, in terms of income and the number of offers, Python boasts a considerable number as shown in the figure below, proving that the world is heading for data science. image.png Python is such a popular and profitable language, but in fact, the learning cost is very low compared to Java and C, and the goodness that even non-programmers can easily write is personally the best. As mentioned above, for me, who dropped out of programming in Java, Python was crisp and made me realize that the world of programming is not far away. That's why I recommend Python.

Is it so easy! ?? How to write Python

Even so, some people may still think, "Because Python is programming, you often remember it, right?" It's true that there are a certain number of things to remember as long as it's a programming language, but Python is still super easy to get started with. First, download Python from the official website. https://www.python.jp/ Click 3.7.2 for "Download" Python on the above site to install it. For a detailed explanation of this, please go to "Python installation method". Anyway, if you can install Python, please start the following program

hello.py


print('Hello World!')

Yes, the output is already "Hello World!". Python has the advantage of being able to output Hello World at the ultimate speed. By the way, many programming languages require some kind of output or variable to be "typed", but the good thing about Python is that it types it for you (good or bad). The reason, good or bad, is that you wrote the following code in Python:

sample.py


a = 2
b = 'hello'
print(a)
print(b)
#2
#hello

The number 2 is assigned to a, and the character string hello is assigned to b. This is not a mistake in itself, so if you output each with a print statement, it will output what you put in a variable properly. And since the contents of the variable are judged to be numeric type (int type) and character string type (str type), it is not necessary to declare each time like other languages, but this is the cause. Since bugs may occur from this, I want you to feel that "Oh, Python has such weaknesses" while gradually remembering it. Anyway, from this point, even non-programmers can suddenly do programming-like things, so it's very fun, and I recommend it because it gives you a versatile feeling like "I SUGEEEE". By the way, as the code that shows the fun of programming most, I had the following.

for_py


for i in range(11):
    print(i)
#0
#1
#2
#3
#4
#5
#6
#7
#8
#9
#10

An excellent one that repeatedly displays numbers up to 10 in no time. I want you to google about this like a Python for statement.

I know Python is hurray, but what can I do?

So far, Python has been written as if it were a universal language, but what you can actually do with Python is as follows. ・ Web-based production (framework is complete) ・ Machine learning ・ Internet scraping (so-called, regularly picking up certain information from a certain site) -Data analysis (same system as Excel, but can be processed more mathematically)

What you can't do is -Creating a dynamic mechanism for websites such as Javascript

  • You can create things like blogs and applications with Flask or Django, but you shouldn't expect a framework like the artist's HP. -A program that can be run in any environment when compiled like Java </ b> I wonder ... There are various things to do, but the good thing about Python is that you can do pretty much anything. The biggest merit is machine learning. In the coming era, I'm sure you've heard about data science, but it's inseparable even if Python's existence is cut off. Of course, R, SPSS, and so on come out in statistical processing, but when you look at Twitter, the trend of the world including the United States is that it is processed by Python. In today's world, Python can only be used, and it doesn't become a magic wand like "Wow! Hiring! Annual income of 10 million!", But if you combine Python with some of your strengths, most jobs have it. I'll just say that I think I'll put it on. We hope that you read this article and become interested in Python and take on the challenge.

Recommended Posts