Showing posts with label Free. Show all posts
Showing posts with label Free. 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



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

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

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

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

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


Monday, June 15, 2020

Python Class 156 (Stock Turnover) - Kapil Sharma

print ("*** Application for Stock Turnover Calculator ***")

print ("\n")

CSV = float(input("Please enter the Cost of Sales:"))
ASV = float(input("Please enter the Average Stock value:"))

ST = CSV / ASV

print ("Total Stock Turnover is",(ST))


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

https://github.com/bornfreesoul/PythonLessons

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

Tuesday, May 19, 2020

Python Class 126 - Kapil Sharma

#Divide function exmaple:- 

def divide_function(num1, num2):
    return num1/num2


Nv1 = float(input("Please enter first amount:"))
Nv2 = float(input("Please enter second amount:"))

result = divide_function(Nv1, Nv2)
print(result)

Code Snippet




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

https://github.com/bornfreesoul/PythonLessons

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

Python Class 125 - Kapil Sharma

#Multiply function exmaple:- 

def multiply_function(num1, num2):
    return num1*num2


Nv1 = float(input("Please enter first amount:"))
Nv2 = float(input("Please enter second amount:"))

result = multiply_function(Nv1, Nv2)
print(result)

Code Snippet




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

https://github.com/bornfreesoul/PythonLessons

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

Saturday, May 9, 2020

Python Class 112 - Kapil Sharma



#Sets are random array of unique datasets myData1 = [1,2,3,4,5,4,3,2,1]my_result = set(myData1)print(my_result)

#Example-2: myData2 = {'iphone':900, 'Samsung': 750, 'Google': 200}print(myData2)print(myData2['iphone'])print('LG' in myData2)print('LG' not in myData2)



#Operators example-3:

print(5<7)
print(5>7)
print(5<=7)
print(5>=7)

https://github.com/bornfreesoul/PythonLessons

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



Monday, May 11, 2015

Python Class 108 - Kapil Sharma

Cheet Sheet: 

1. List = Arrays.

   List = ["One","Two","Three"];
   print List[2];

2. Tuple() = List, but its cannot be changed. (Unmutable)/xyz[2]


3. Sets = Are similar to list, un-ordered collection of unqiue elements.

   No, duplicates.

4. Dictionaries{} = Arrays. Un-order collections of key value pairs.

   dict = {"Key":"Value"}

5. __XYZ = Is declaring local variable by adding "__"


6. pop / remove: Both do the same thing.

   But implementation is different. In "pop" user needs
   to give index id: xyz.pop(1) / xyz.remove("abc")

7. xyz.find("abc"): Give the location index id of the text. 


8. "is": For same value, like one = two = [1,2,3] its true.


9. "in": For checking true values, "s" in "Kiwi" its false.


Python GitHub Repo: https://github.com/bornfreesoul/Python

Tuesday, December 9, 2014

Python Class 104 - Kapil Sharma

Python CBT on YouTube:



Python Class 103 - Kapil Sharma

Function Creation:

>>> def functionName1():>>> print("Kapil")
>>>
>>> functionName1()
>>> Kapil

To create a python function 'def' word needs to be pre-fix in front of user function name end by"():"

OR

Users can also create functions like this way:

>>> def functionName2(Message):
>>> print(Message)
>>> functionName2("This is my message!")
>>> This is my message!

OR

>>> def functionName3(Message = "My Message."):
>>> print(Message)
>>> functionName3()
>>> My message.

OR

>>> def addVal1(Val1, Val2):
>>> print(Val1, "+" Val2, "=",(Va1 + Val2))
>>> addVal1(3,2) #User add the value 3,2
>>> 5  #Python IDE result is 5

OR

>>> def addVal2(Val1, Val2):
>>> return Val1 + Val2
>>> print("2 + 3 equals to 4 + 1 is ", (addVal2(2,3) == addVal2(4,1)))
>>> 2 + 3 equals to 4 + 1 is True #Python IDE result is 5 equal 5 True.


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