Monday, October 12, 2020

Python Class 186 (Missile Speed Calculator) - Kapil

I/P:

print ("** Missile speed calculator **")

print()
MSV = float(input("Please enter the missile speed in Mach: "))

KMV = 1234*MSV

PSV = KMV/60/60
print()
print("The missile travel: %.2f" %PSV,"KM per second speed")
print()
MRV1 = float(input("Please enter the missile range in KM: "))

MRV2 = MRV1/PSV
print()
print("Missile travel",MRV1,"KMs in %.2f" %MRV2, "seconds.")

O/P:
** Missile speed calculator ** Please enter the missile speed in Mach: 8 The missile travel: 2.74 KM per second speed Please enter the missile range in KM: 450 Missile travel 450.0 KMs in 164.10 seconds.


===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg


Tuesday, September 15, 2020

Python Class 185 (Price-to-Earnings Ratio) - Kapil

 print ("** Price-to-Earnings Ratio **")


#Price per share / Earnings per share = P/E Ratio

PPS = float(input("Please enter price per share: "))
EPS = float(input("Please enter earnings per share: "))

PER = PPS / EPS

print("Price-to-Earnings Ratio is: %.2f" %PER)


===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg


Monday, September 7, 2020

Python Class 184 (List, Operators) - Kapil

my_list1 = ["Kapil", "Apil",0,1,2,3,4]


for my_items in my_list1:

        print(my_items * 2)

        print(my_items, 2*2)


O/P: 

KapilKapil Kapil 4 ApilApil Apil 4 0 0 4 2 1 4 4 2 4 6 3 4 8 4 4



===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg



Wednesday, August 19, 2020

Python Class 183 (Classification Metrics: Recall) - Kapil

I/P:
print("*** Classification Metrics: Recall ***")
print()
TPV = float(input("Please enter the True Postive value: "))
FNV = float(input("Please enter the False Negative value: "))
print()
RV1 = TPV+FNV
RV2 = TPV/RV1
print()
print("The Recall Value is %2f"%RV2)

#*(Bad) 0 </ Recall </ 1 (Good)


O/P

*** Classification Metrics: Recall *** Please enter the True Postive value: 2 Please enter the False Negative value: 8  

The Recall Value is 0.200000 



===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg


Saturday, August 15, 2020

Python Class 182 (Money Exchange Rate ) - Kapil

 print("*** Money Exchange Rate Application ***")

# c = a * b
# MER = Money After Exchange / Money Before Exchange
print()
AFE = float(input("Please enter the money amount after exchange: "))

MBE = float(input("Please enter the money amount before exchange: "))

MER = AFE / MBE
print()
print("The money exchange forumla ratio one is: %2f" %MER)
print()

print("Money exchange rate formula two: ")

c = MBE * MER

print("Money exchange amount for received for currency conversion is: %2f" %c)


===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Wednesday, August 12, 2020

Python Class 181 (Gratuity Calculator Application) - Kapil

print ("*** Gratuity Calculator Application ***")
print()
LSD = float(input("Please enter your last drawn salary amomunt for your current company: "))
NYW = float(input("Please enter number of years working in current company: "))
print()
TGA = LSD * (15/26) * NYW
print("The total gratuity amount is: %.2f" %TGA)

===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Saturday, August 8, 2020

Python Class 180 (Profit calculation on basis of stock dividend ) - Kapil

print ("** Stock dividend - calculator application **")

print()

TNST = float(input("Please enter the count of total number of stocks: "))
ADPO = float(input("Please enter annual dividend payout per annum: "))
CSPP = float(input("Please enter the current stock price: "))

DPAY = (ADPO/CSPP) * 100

print()

print("The annual dividend yield value is: %.2f " %DPAY)

print()

TPSV = ADPO * TNST

print("Total profit due to dividend is: %.2f" %TPSV)

===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Friday, August 7, 2020

Python Class 179 (Histogram plotting) - Kapil

 import pandas as pd

import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt

iris = pd.read_csv("iris.csv")

sns.FacetGrid(iris, hue="variety", height=5).map(sns.distplot,"petal.length")
.add_legend()
plt.show()

===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Thursday, August 6, 2020

Python Class 178 (Dataset plotting) - Kapil

import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np

iris = pd.read_csv("iris.csv")
print(iris.shape)
print(iris.columns)
print(iris.rank)


===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Wednesday, August 5, 2020

Python Class 177 (Compare two lists) - Kapil

import random

I/P:
l1 = list(range(5))
random.shuffle(l1)


l2 = list(range(10))
random.shuffle(l2)

count = 0
for i in l1:
    for j in l2:
        if i == j:
           print(i)
           count +=1
print("Common numbers are as following: ", count)

-------------------------------------------------

O/P:
0 4 3 1 2 Common numbers are as following: 5

-------------------------------------------------


===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Wednesday, July 22, 2020

Python Class 176 (Dictionary Functions) - Kapil

I/P:
Idic = {'name':'Kapil', 'age' : 100, 'Search':'Running'}
Idic['name'] = 'ram'
print(Idic)
Idic['education'] = 'P.G'
print(Idic)
print(Idic.pop('education'))
print(Idic)
del Idic['Search']
print(Idic)
print(Idic.keys())
print(Idic)
print(Idic.values())
print(Idic)
k = {}
print(dir(k))



O/P: 
{'name': 'ram', 'age': 100, 'Search': 'Running'}
{'name': 'ram', 'age': 100, 'Search': 'Running', 'education': 'P.G'}
P.G
{'name': 'ram', 'age': 100, 'Search': 'Running'}
{'name': 'ram', 'age': 100}
dict_keys(['name', 'age'])
{'name': 'ram', 'age': 100}
dict_values(['ram', 100])
{'name': 'ram', 'age': 100}
['__class__', '__contains__', '__delattr__', '__delitem__', 
'__dir__', '__doc__', '__eq__', '__format__', '__ge__', 
'__getattribute__', '__getitem__', '__gt__', '__hash__', 
'__init__', '__init_subclass__', '__iter__', '__le__', '__len__', 
'__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', 
'__repr__', '__setattr__', '__setitem__', '__sizeof__', '__str__', 
'__subclasshook__', 'clear', 'copy', 'fromkeys', 'get', 'items', 
'keys', 'pop', 'popitem', 'setdefault', 'update', 'values']


===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Sunday, July 19, 2020

Python Class 176 (Odd/Even Numbers from a range) - Kapil

index1 = int(input("Please enter the starting range number: "))
index2 = int(input("Please enter the ending range number: "))

print("\n")

print("Prime number between {} and {} are:".format(index1, index2))

for num in range(index1,index2):
    if (num > 1):
        isDivisible = False
        for index in range(1, num):
            if (num % index == 0) or (num % 2 == 0):
                print("\n")
                print(num, "- is even number.")
                print("\n")
                isDivisible = True
                print(num,"The number is not prime.")
                break
        if not isDivisible:
            print("\n")
            print(num, "is a prime number.")
            print("\n")


===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Python Class 175 (Even Numbers) - Kapil

numbers = [1,2,3,4,5]
for num in numbers:
  if num % 2 == 0:
      print(num, "- is even number.")
      continue
  print(num, "- is odd number.")
else:
  print("\n")
  print("For loop exited.")
--------------------------------------

num = int(input("Please enter the number:"))
isDivisible = False
i = 2
while i < num:
    if num % i == 0:
        isDivisible = True
        print("{} is divisible by {}".format(num,i))
        break
    i +=1
if isDivisible:
    print("{} is NOT a prime number".format(num))
else:
   print("{} is a prime number".format(num))

-----------------------------------------------------------
===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Saturday, July 18, 2020

Python Class 174 (Prime Numbers in a range) - Kapil

index1 = int(input("Please enter the starting range number: "))
index2 = int(input("Please enter the ending range number: "))

print("\n")

print("Prime number between {} and {} are:".format(index1, index2))

print("\n")
for num in range(index1,index2):
    if (num > 1): 
        isDivisible = False
        for index in range(2, num):
            if (num % index == 0):
                isDivisible = True
                print(num,"The number is not prime.")
        if not isDivisible:
            print("\n")
            print(num, "is a prime number.")
            print("\n")



===============================================================
https://github.com/bornfreesoul/PythonLessons
https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Sunday, July 12, 2020

Python Class 173 (Money Call Calculator, Part-IV) - Kapil

while loop == 1:
    x = input("Press 0 to exit otherwise anything to continue:")
    if x == "0":
      break

    print ("*** Money Application ***")
    print("\n")
    print("Money Call")

    def SeventyTwo_function(n1,n2):
              return(n1/n2)

    print("\n")
    UV = float(input("Please enter the value of rate of interest:"))
    print("\n")
    print("Time to double the investment in years is:",SeventyTwo_function(72,UV))
    print("\n")
    AI = float(input("Please enter the amount value invested:"))
    print("\n")
    FF = AI * 2
    print("The final double amount value is:",FF, "after",SeventyTwo_function(72,UV),"years of investment.")


===============================================================
https://github.com/bornfreesoul/PythonLessons

https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Saturday, July 11, 2020

Python Class 172 (Money Double Calculator, Part-III) - Kapil

print("*** Money Rule of 72 ***")
def SeventyTwo_function(n1,n2):
          return(n1/n2)
print("\n")
UV = float(input("Please enter the value of rate of interest:"))
print("\n")
print("Time to double the investment in years is:",SeventyTwo_function(72,UV))
print("\n")
AI = float(input("Please enter the amount value invested:"))
print("\n")
FF = AI * 2
print("The final double amount value is:",FF, "after",SeventyTwo_function(72,UV),
"years of investment.")

===============================================================

https://github.com/bornfreesoul/PythonLessons

https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Python Class 171 (Money Double Calculator, Part-II) - Kapil

print("*** Rule of 72 ***")

def SeventyTwo_function(n1,n2):
          return(n1/n2)
print("\n")
UV = float(input("Please enter the value of rate of interest "))
print("\n")
print("Time to double the investment is:",SeventyTwo_function(72,UV))




===============================================================

https://github.com/bornfreesoul/PythonLessons

https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Tuesday, July 7, 2020

Python Class 170 (Multi Function Call) - Kapil

print ("*** Multi Function calls application example ***")

def MATH_function(n1,n2):
        return (n1*n2), (n1/n2)

def SQY1_function(n1,n2):
        return(n1*2, n2*2)

def SQY2_function(n1,n2):
        return(n1**2, n2**2)

print ("\n")
print("The multiply function call result is:",MATH_function(3,3))
print ("\n")

print("The squre root function call result is:",SQY1_function(10,5), 
"& The squre root function call result is:", SQY2_function(10,5))



===============================================================

https://github.com/bornfreesoul/PythonLessons

https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Monday, July 6, 2020

Python Class 169 (Money Double, Part-I) - Kapil

print ("*** Application to calculate time to double amount ***")

#TTDA = 72 / Rate of Return 

def doubleAmt_function(n1,n2):
              return(n1/n2)
print("\n")

print ("The years taken to double the amount is:", doubleAmt_function(72,15))

------------------------------------------------------------------------------

print ("*** Application to calculate time to double amount ***")

#TTDA = 72 / Rate of Return 
print("\n")
RRV = float(input("Please enter the rate of return %: "))
print("\n")
TTDA = 72 / RRV 

print ("The years taken to double the amount is:", TTDA)


===============================================================

https://github.com/bornfreesoul/PythonLessons

https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Monday, June 29, 2020

Python Class 168 (Function Calls) - Kapil

print ("*** Four function call application example ***")

def MUL_function(n1,n2):
        return (n1*n2)

def DEV_function(n1,n2):
        return (n1/n2)

def SQY1_function(n1,n2):
        return(n1*2, n2*2)

def SQY2_function(n1,n2):
        return(n1**2, n2**2)

print ("\n")
print("The multiply function call result is:",MUL_function(3,3))
print ("\n")
print("The divide function call result is:",DEV_function(10,5))
print ("\n")
print("The squre root function call result is:",SQY1_function(10,5))
print ("\n")
print("The squre root function call result is:",SQY2_function(10,5))


===============================================================

https://github.com/bornfreesoul/PythonLessons

https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Friday, June 26, 2020

Python Class 167 (Event Probability) - Kapil


print ("*** Application to know the probability of an event ***")

def PEV_function(n1,n2):
        return (n1/n2)

print ("\n")
#P(E) = (Number of outcomes favorable)/(Total number of outcomes)
OFV = float(input("Please enter the current Number of outcomes favorable:"))
TOV = float(input("Please enter the total number of outcomes:"))

print("The probability of an event is:",PEV_function(OFV,TOV))

-----------------------------------------------------------------------------------------------------------

print ("*** Application to know the probability of an event ***")

print ("\n")

#P(E) = (Number of outcomes favorable)/(Total number of outcomes)
OFV = float(input("Please enter the current Number of outcomes favorable:"))
TOV = float(input("Please enter the total number of outcomes:"))

PEV = OFV/TOV

print("The probability of an event is:",PEV)



===============================================================

https://github.com/bornfreesoul/PythonLessons

https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Thursday, June 25, 2020

Python Class 166 (Current Density) - Kapil

print ("*** Application to know the current density of an object ***")

print ("\n")

IV = float(input("Please enter the current flowing through the conductor in Amperes:"))
AV = float(input("Please enter the denotes the cross-section area in m2:"))

CDV = IV/AV

print("The  current density is:",CDV)


===============================================================

https://github.com/bornfreesoul/PythonLessons

https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Tuesday, June 23, 2020

Python Class 165 (Transformer Formula) - Kapil

print ("*** Application to calculate the transformer formula ***")

print ("\n")

# primary voltage (Vp = Np / Ns * Vs)

NPV = float(input("Please enter the number of turns in the primary:"))
NSV = float(input("Please enter number of turns in the secondary:"))
VSV = float(input("Please enter the secondary voltage:"))

VPV1 = NPV / NSV 

VPV2 = VPV1 * VSV

print ("\n")

print("The the transformer formula value (Vp) is: %.2f" %VPV2,"V")


===============================================================

https://github.com/bornfreesoul/PythonLessons

https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Monday, June 22, 2020

Python Class 164 (Wave Energy Density) - Kapil


print ("*** Application to calculate the Wave Energy Density ***") print ("\n") # The wave energy formula is given by, WDV * EGV * (H * H)/16 WHV1 = float(input("Please enter the Wave height (H) in meters:")) WHV2 = WHV1 * WHV1 #Water density ρ = 999.97 kg/m3 WDV = 999.97 #Gravity g = 9.8 m/s2 EGV = 9.8 WED1 = WDV * EGV * WHV2 WED2 = WED1 / 16 print ("\n") print("The the Wave Energy Density value is: %.2f" %WED2,"J")


===============================================================

https://github.com/bornfreesoul/PythonLessons

https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg


Saturday, June 20, 2020

Python Class 163 (Celsius Temperature) - Kapil

print(" **** Application to calculate Celsius Temperature. **** ")

print("\n")

#C = (F-32)/1.8

FV = float(input("Please enter the Temperature in Fahrenheit: "))

CV = (FV-32)/1.8

#("%.2f" % a) - Limiting floats to two decimal points
print("\n")

print("The Temperature in Celsius is:%.2f" %CV)


===============================================================

https://github.com/bornfreesoul/PythonLessons

https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg

Python Class 163 (Fahrenheit Temperature) - Kapil

print(" **** Application to calculate Fahrenheit Temperature. **** ") print("\n") #F = (C * 1.8) + 32 CV = float(input("Please enter the Temperature in Celsius: ")) FV = (CV * 1.8) + 32 print("The Temperature in Fahrenheit is:",FV)


===============================================================

https://github.com/bornfreesoul/PythonLessons

https://www.youtube.com/channel/UCe0rLJmSQXNoK2Mo2eMVuvg 


Blockchain: 101 (By - Kapil Sharma)

 https://testing-mines.blogspot.com/2021/10/blockchain-101-by-kapil-sharma.html Blockchain through the following attributes: Distributed:  T...