Skip to main content

Command Palette

Search for a command to run...

Python - The easy way

Updated
•2 min read•View as Markdown
Python - The easy way
A

I am a 18 y/o web developer , User Interface Designer and Python Programmer from India.

I love to share my experiences with people all over the internet.

Connect with me and have a great time reading the blogs.

Hello world, how y'll are doing?

This is my first issue of this newsletter, I will be telling you some good concepts in as short as possible. You wanna subscribe? Get a free cheatsheet from adicode.ml/gumroad and you will be subscribed.

images.jpg

1. Map Function

Map takes a function and a collection of items. It makes a new, empty collection, runs the function on each item in the original collection and inserts each return value into the new collection.

image.png

2. Lambda Function

The idea of lambda function is to evaluate expressions easily. The parameters of the lambda are defined to the left of the colon. The function body is defined to the right of the colon.

image.png

3. Complex Numbers

People dont usually focus on this topic, but python cmath has a variety of functions for this topic as well.

  • If we want to write 2+3i as complex number in python, it would be written as 2+3j

  • You can also define complex numbers using the complex() function

  • We can also use “a.real” and “a.imag” to filter equation

image.png

4. Try.....Except.......Finally

The try block is used to check some code for errors. Whereas the code inside the except block will execute whenever the program encounters some error in the try block. No matter what is exception, code inside finally is always executed.

image.png

Thats it from my side for this week’s newsletter. Meet you in next wednesday. Can’t wait till next week? Follow me on twitter where I post these stuff daily.

More from this blog

A

Aditya Tiwari

14 posts

A python learner and Machine Learning Enthusiast sharing his learnings in the form of blogs.