This website collects cookies to deliver better user experience
6 Python Easy Tricks for beginners
6 Python Easy Tricks for beginners
Hello fellow coders! Today I'm going to tell you 6 python tricks that you can use to make your learning journey fun and easy.
1. Swapping Numbers
Swapping is important concept when it comes to data structure and algorithm. In normal way we need to create a temporary variable to swap the numbers. But in Python it's just easy..
a,b =10,20# Before Swappingprint(a,b)# OUTPUT : 5 10#Swapping Variablesa, b = b, a
print(a,b)# OUTPUT : 10 5
2. Opening a Website
Opening website using a python library.This is how we can open a website with just a single line of code.