Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

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

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

Friday, June 19, 2020

Python Class 162 (Surface Tension) - Kapil

print(" **** Application to calculate surface tension. **** ")

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

print("\n")
#T = F/L

FV = float(input("Please enter the force per unit length in Newton: "))
LV = float(input("Please enter length in which force act in per Meter: "))

print("The surface tension of the liquid:", force_function(FV, LV), "N/m")


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

https://github.com/bornfreesoul/PythonLessons

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



Sunday, June 7, 2020

Python Class 145 (Relative Frequency) - Kapil Sharma

#Relative Frequency  = Successful trials / Total number of trials 

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

ST1 = float(input("Please enter the successful trials count:"))
TT2 = float(input("Please enter the number of trials count:"))

RF = RelativeFrequency_function(ST1, TT2) * 100

print("The Relative frequency percentage is:",RF, "%")


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

https://github.com/bornfreesoul/PythonLessons

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

Saturday, June 6, 2020

Python Class 144 (Profit Margin) - Kapil Sharma

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

NP1 = float(input("Please enter Net Profit After Tax value:"))
NS2 = float(input("Please enter Net Sales value:"))

#Profit Margin Formula = Net Profit After Tax / Net Sales 

print ("The Profit Margin is:",(ProfitMargin_function(NP1, NS2)))


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

https://github.com/bornfreesoul/PythonLessons

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

Thursday, June 4, 2020

Python Class 142 (Tax Rate for Corporation) - Kapil Sharma

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

TE1 = float(input("Please enter total Tax Expenses value:"))
ET2 = float(input("Please enter total Earnings Before Taxes value:"))

#Effective Tax Rate for Corporation = Total Tax Expenses / Earnings Before Taxes

print ("The Effective Tax Rate for Corporation is:",(TaxRate_function(TE1, ET2)))



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

https://github.com/bornfreesoul/PythonLessons

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

Wednesday, June 3, 2020

Python Class 140 (Total Sale) - Kapil Sharma

print ("*** Application for Total Sale Amount Formula ***")

print ("\n")

SP = float(input("Please enter the Selling Price value:"))
ST = float(input("Please enter the Sale Tax value:"))

#Total sale amount = selling price + sales tax.

TSA = SP + ST 

print ("The total sale amount value is:" , (TSA))


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


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...