How to Learn Python: A U.S. News Guide


Whether you want to automate a few tasks on your desktop or explore a new career in technology, learning Python can help you make that happen.

(Getty Images)

It’s known in developer circles as a programming language that can meet a variety of needs, and it’s easier to pick up than some alternatives. Perhaps that’s why Python is so popular. According to the PYPL index, which tracks how often programming language tutorials are searched on Google, Python ranked No. 1 worldwide as of November 2020.

Here’s a closer look at what makes Python worth learning and what classes or other resources can help get you started.

Python was created in 1991 by programmer Guido van Rossum, who named it for the British comedy series “Monty Python’s Flying Circus.” It was built to be easy to use but also powerful enough for a range of jobs. You can use it to build a simple calculator, develop a website or even employ machine learning techniques as a data scientist.

“Python as a language is very dexterous and enables a wide spectrum of usage for all skill levels,” says Sabin Thomas, vice president of application security engineering for Threat Stack Inc., a cloud security company.

Python is well-suited for tasks big and small. Here are some reasons why:

  • The language is open source, meaning users can change and share it at will.
  • Users can take advantage of the free tips and custom programs put out by large communities of open-source enthusiasts and Python developers.
  • Python comes with a robust standard library, which can help troubleshoot issues or speed up development efforts, minimizing the amount of original code users have to write.

Python Syntax

A key characteristic of Python is it can accomplish the same basic tasks other languages can by using much simpler code. Its syntax, referring to the rules that govern how programmers can use the code, is part of the reason for that.

Most programming languages have complex rules, and the code is often defined by a set of characters that can seem like gobbledygook to those with no programming background. Python’s syntax is so simple that you’ll probably find yourself using mostly natural language words when you start.

For example, if you want to display “Hello, and Welcome to Python” on the screen, simply type:

print("Hello, and Welcome to Python")

For Java – not the coffee but the programming language – to display “Hello, and Welcome to Python” on screen, users would have to type:

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, and Welcome to Python");

An easier syntax also makes other elements easier to use in Python. This includes functions, lines of code represented by characters that run when called on. Users can input a series of requests into a function, and it can return an output in the form of data or manipulate other parts of the program.

In Python, you can define a function using the def keyword command. For example:

def my_function():
    print("This is a function.")

Calling the function my_function() runs the code defined within it, without having to rewrite all of it. In the example above, calling that function would display the text “This is a function.”

Python Loops

Loops in Python let programmers launch a series of statements multiple times. An example is the “for” loop, which goes over each item in a sequence.

cars = ["Corvette", "Ferrari", "Lambo", "Ford"]
for y in cars:

This command in Python displays every item mentioned in (y), and the programmer gets this output:

As simple as loop statements seem, when you have to go over a massive list as you do something like build a large website, these simple statements can be surprisingly useful. They are also helpful when moving to more complicated uses for Python, such as in data science and machine learning.

Data scientists use programming languages like Python to gather and process data to produce insights that their organizations can act on. Although data science is a separate field from computer science, data scientists often use concepts from computer science to create programs that help aggregate and analyze data.

What makes Python well-suited for data science are the same attributes that make it popular in other fields – its scalability, large community and ease of use. Also, Python is a flexible language, which allows data scientists to use it to solve a range of problems.

One of the tools in a data scientist’s tool belt is machine learning, the ability to make a computer interpret data to predict an outcome. Python has a number of libraries that make it easier for data scientists to use machine learning techniques. For example, the Scikit-learn library is a popular choice for those looking to do things like group data into clusters or develop regressions, which helps show relationships in data sets.

Python has the potential to add value to advanced machine-learning-based capabilities called neural networks and to data science as a whole, says Tate Nurkin, nonresident senior fellow with the Forward Defense Initiative at the Atlantic Council think tank and CEO of consulting company OTH Intelligence Group. Both neural networks and data science, he says, “are core to the future of nearly every industry and definitely to the future of defense, security capabilities and operations.”

Python is free to download and use. To start, visit the Python Software Foundation’s website and select your operating system – Python works on Windows, iOS or Linux. Then, follow the instructions.

Python 3 is the most current version. While some older code may use Python 2, it’s no longer being supported, according to the Python Software Foundation. One key difference between the two is the syntax behind certain statements. For example, Python 3 uses parentheses in the print function. Python 2 doesn’t.

After you download Python, you’ll need a few tools. Here are some of the most recommended:

  • Jupyter Notebook can allow users to more easily write code and collaborate with others.
  • The Python Debugger, which is available in Python’s standard library, helps users find and fix code errors.
  • Ipython is a user interface preferred by some programmers for supporting fun data visualization capabilities.

You’ll also want to access a couple key libraries. In its blog, software development company Django Stars recommends these libraries for Python programmers interested in data analytics and machine learning:

  • Scikit-learn, for basic machine learning algorithms.
  • Pandas, for high-level data analysis.
  • Keras, for more machine learning guides.

YouTube has a wealth of videos on Python tips and tricks. Check out the CS Dojo channel to learn the basics. If you are new to technology, consider taking introductory classes offered from online institutes like Dataquest, LinkedIn Learning, Coursera or edX.

When you’re starting out, set some goals. Consider concentrating on the most common commands and most popular tools in the first two months. During month three and four, reinforce basic programming knowledge with a small project. During this phase, it is important to become familiar with online forums like Stack Overflow and Codecademy to build a community of collaboration and feedback for harder issues that will arise later in your development.

Learning Python well enough to pursue a career in Python programming can take as little as a couple of months if you have experience programming in other languages.

Programming Hero, which offers interactive coding tutorials, says you can learn Python in as little as two months. But that assumes you can sit in front of a computer every day and practice from 8 a.m. to 5 p.m.

If you have a day job, six months may be a more realistic timeline. That would require you to spend two to three hours a day, at least five days a week, working at a computer learning Python.

Keep in mind that Python developer or programmer roles can be quite varied. Not only that, but you also could use Python as a back-end web developer, data scientist, quality assurance engineer or systems engineer. Each of these jobs requires different knowledge on how to use Python and common tooling to fulfill the responsibilities of the role.

As you learn Python, focus on diving deep into how to apply the language to the role that you want.

The time and effort required to land a Python programming job depends on your experience. It’s important to demonstrate your skills through relevant Python projects. You may also want to create a website that showcases your projects and accomplishments.

According to Praxis, an online boot camp, a portfolio shows prospective employers your problem-solving capabilities and your ability to write code and document your steps. (If programming were like cooking, the code would be the cake and the documentation would be your ability to write out the recipe.)

It also shows that you can apply your coding skills in a variety of situations and take advantage of online resources. The online learning site Simplilearn suggests starting a repository on GitHub, a website that can house your portfolio and serve as a resume. That way, you can share your work samples with recruiters, neatly packaged into zip files.

It also is important to be able to discuss other programming languages that you enjoy. No one wants a Python robot. Good programmers dabble in all sorts of code and tech. Be prepared to talk about what you found easy and hard about learning Python and what major challenges you have had in the past, not just with code but with technology in general, and the steps you took to surmount them.

Many Python roles also require applicants to have experience with agile, a development mindset that emphasizes collaboration and the ability to switch gears as plans change.

“Proving that you can collaborate with others to solve problems is a vital aspect during the job interview process,” said Nurkin. “It’s one thing to be a solid programmer, it’s another thing if you’re a programmer that works well with others to solve big challenges.”


Source link

Leave a Reply