Wednesday, September 25, 2024

Purpose of Life

 Purpose of Life

Life is not merely about paying bills. It is not just about the routine of eating, sleeping, waking up, going to the office, and working long hours. Life is not solely for taking care of your children and parents, nor is it just about traveling the world. It is not simply about earning lots of money and paying taxes to government on everything we buy.

Life is a collection of 

Relationships: Building meaningful connections with family, friends, loved ones and The Supreme One

Personal Growth: Continuously learning, growing, and improving self

Passions and Hobbies: Engaging in activities that bring joy and fulfillment*

Helping Others: Making a positive impact on others' lives through kindness, support, and service

Experiences: Exploring new places, cultures, and experiences that enrich our understanding of the world

Spirituality: Seeking a deeper understanding of existence and one's place in the universe.

Life is for discovering joy in the little things, for building meaningful relationships, and for pursuing passions that ignite your soul. It is about personal growth, learning, and evolving. Life is for making a positive impact on others, for acts of kindness, and for contributing to the greater good. It is about experiencing the beauty of the world, embracing new adventures, and finding your own path to fulfillment.

Tuesday, September 17, 2024

Generate a Truly Random N digit number in Python

Copyable code at the bottom
















import time


RandomNoOfDigits = 2

print(f'Generate a random no of {RandomNoOfDigits} digits')

# use timestamp

ts = time.time()


# Convert timestamp into string

strTs = str(ts)


# split string using . and take part after decimal

strTs = strTs.split('.')

randomNo = strTs[1][-RandomNoOfDigits:]

print(f' 1 Random = {randomNo}')


''' If unit digit is 0, random no won't be of that many digits.

Ex: 03. So replacing unit digit 0 with 4 (my wish)

'''

if(int(randomNo[0]) == 0):

    randomNo = randomNo.replace('0','4')

    #randomNo[0]=4

    print(f' 11 Random = {randomNo}')


print(f' 2 Random = {randomNo}')