Skip to main content

How To Learn Python If You Already Know A Different Programming Language

I knew C before I learnt Python. There are differences between the languages, but, it is very easy if Python is your second language.

Why learn Python? C has tens of lines of codes which could be done within one line with the help of Python Libraries. Python is just easier and equally powerful. It is also a great scripting language if you wanted to learn a scripting language.

If you have a programming background, Python is pretty straightforward to pick up. The most onerous task is learning the libraries and idioms.

You already know how programs work and you might have an idea about programming methodology. This makes learning Python a simple process. If you're learning Python and want to do it fast, I recommend this:

Learn X in Y minutes(Python)

This will teach you the keywords and syntax in a matter of minutes.

Most people don't know this, but the official Python docs are a goldmine.
It is very well written and is as good as any book. Already knowing how to program in a different programming language just makes it easier to understand using these docs.

Official Python Docs

Here are a few other resources that might help you:

A quick introduction:

Python Syntax in 5 Minutes! 

If you already know Java, use this:

Python for Java Programmers

If you already know JavaScript:

Python for JavaScript Programmers Made Easy

You could also use a book like Dive Into Python

Other helpful links:

For Python libraries, you need to specialize in the libraries that might be useful for you.

  • For Web Development(Frameworks): Django, Flask, Web2Py, TurboGears etc
  • If you're doing number crunching you'll almost certainly want to become familiar with the Numpy and Scipy libraries
  • The Requests library is the defacto standard for making HTTP requests in Python. It abstracts the complexities of making requests behind a beautiful, simple API so that you can focus on interacting with services and consuming data in your application.
  • Beautiful Soup is a Python package for parsing HTML and XML documents. It creates a parse tree for parsed pages that can be used to extract data from HTML, which is useful for web scraping.
  • If you are involved in web-scraping then this is a must have library for you. After using Scrapy library you won’t use any other. 
  • You could learn something like SQLAlchemy for databases.
  • If you're into game development, PyGame is the library for you!
  • For Machine Learning, you could look into something like TensorFlow, Scipy or PyTorch
  • For Data Science, go for Pandas and Matplotlib 
  • For Network Programming, paramiko, socket, tftpy, HTTPLib2
  • IPython
Note: These are not all the libraries. There are hundreds of libraries, the libraries mentioned here are just examples of some popular ones. You'll need to do a bit of Googling to find out which Python Library is best for you to learn.

 

The Best Way to Learn:

These links will just help you to learn the basics. But, the best way to learn is to start programming right away.

Choose a big project you like to build or something you've already built and BUILD IT USING PYTHON.

This will automatically make you learn. You could use websites like Reddit or StackOverflow to get your queries and doubts answered.


Final Thoughts: 

JUST START. Learn the syntax and the keywords and START WITH A PROJECT. Python is easy to learn but a very powerful language. 

My advice is to find a problem and set off to solve it with Python. You will learn a lot in the process.

You already know the concept, its just learning the syntax and a few extra thing because it works slightly differently.

Happy Coding!


Thanks for reading,

AZID








Comments

Most Viewed Content:

Best Reddit Subreddits for Cybersecurity and Hacking!

Reddit is a very useful website for discussions about everything. For cybersecurity and hacking too, it has useful subreddits, in which, you will learn a lot of things you previously had no knowledge of. So, I have compiled a list of security related subreddits. 1. Active and Most helpful subreddits: /r/netsec /r/AskNetsec /r/netsecstudents These three are pretty much it. They have very active communities and are very helpful. I, personally use  /r/netsecstudents a lot because I'm still in the process of learning and that subreddit(if you look properly) will tell you how to make a career in every security field. 2. Security Certification Subreddits: r/CompTIA (for Security+) r/ccna (for CCNA and CCNA Security, also r/ccnp for CCNP) r/CEH (for CEH) r/cissp (Certified Information Systems Security Professional) r/oscp (Offensive Security Certified Professional) Really helpful if you're doing any of these Certs. 3. Other

OverTheWire Bandit: Level 0-14

Bandit Levels Levels 0-14 Levels 14-25 Levels 25-33 Please use Ctrl+F to find your desired Level. Level 0 Bandit Level 0 Level Goal The goal of this level is for you to log into the game using SSH. The host to which you need to connect is bandit.labs.overthewire.org, on port 2220. The username is bandit0 and the password is bandit0. Once logged in, go to the Level 1 page to find out how to beat Level 1. Commands you may need to solve this level 2/31 ssh kali@kali:~$ ssh bandit0@172.9.9.176 -p 2220 password: bandit0 Level 0 -> Level 1 Level Goal The password for the next level is stored in a file called readme located in the home directory. Use this password to log into bandit1 using SSH. Whenever you find a password for a level, use SSH (on port 2220) to log into that level and continue the game. Commands you may need to solve this level ls, cd, cat, file, du, find Password for next level: boJ9jbbUNNfktd78OOpsqOltutMc3MY1 Level 1 -> Level 2 Level Goal The password for the next le

OverTheWire Bandit: Level 14-25

Please Ctrl+F to find your desired level. Levels Levels 0-14 Levels 14-25 Levels 25-33 Level 14 -> Level 15 Level Goal 11/31 The password for the next level can be retrieved by submitting the password of the current level to port 30000 on localhost. bandit14@bandit:~$ cat /etc/bandit_pass/bandit14 4wcYUJFw0k0XLShlDzztnTBHiqxU3b3e This is the current level password. Now, to find the password of the next level. bandit14@bandit:~$ telnet localhost 30000 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 4wcYUJFw0k0XLShlDzztnTBHiqxU3b3e Correct! BfMYroe26WYalil77FoDi9qh59eK5xNr Connection closed by foreign host. The password for the next level is BfMYroe26WYalil77FoDi9qh59eK5xNr We can ssh bandit15@localhost Level 15 -> Level 16 Level Goal The password for the next level can be retrieved by submitting the password of the current level to port 30001 on localhost using SSL encryption. Helpful note: Getting “HEARTBEATING” and “Read R BLOCK”? Use -ign_eof and r