DevRa

  • Home
  • Blog
    Posts Sections
    Tags
  • About
  • Contact
  • Privacy

Awesome Python Tips & Tricks - (Page 1/1)

A better dictionary in python

A better dictionary in python

A Python dictionary is a very useful data structure that stores key value pairs. A python dictionary is declared like the following-

programming python
Powerful Python One Liners

Powerful Python One Liners

Why write more code when you can write less? Become a Python Ninja with the below one-liners.

programming python
Reduce Too Many if-elif in Python

Reduce Too Many if-elif in Python

if-elif statements are one of the used features of Python. However, they can become hard to read when the number of elif statements increase. Let’s consider the following code for a game: # Assume run(), stop(), shoot(), guard() methods are defined command = input() if command == "run" run() elif command == "stop" stop() elif command == "shoot" shoot() elif command == "guard" guard() .

programming python
Things You're doing wrong in Python

Things You're doing wrong in Python

Avoid these things in Python to write better code and make better software.

programming python
Tips & Tricks to Make Python Faster!

Tips & Tricks to Make Python Faster!

Python is known for being slow in terms of execution speed. However, you can try out the following tricks to make your code faster.

programming python
Useful f-string Techniques in Python

Useful f-string Techniques in Python

Python f-strings are super useful for formatting strings. Before python 3.6 str.format() were used. But f-strings makes string manipulation much more easier and effective.

programming python

© 2021 Rafed Muhammad Yasir.