Showing posts with label HowTo. Show all posts
Showing posts with label HowTo. Show all posts

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

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

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

Tuesday, June 16, 2020

Python Class 157 (Expecting Returns) - Kapil Sharma

print ("*** Application for Expecting Returns Calculator ***")

print ("\n")

CPV = float(input("Please enter the Closing Price:"))
OPV = float(input("Please enter the Opening Price value:"))

ER1 = CPV - OPV
ER2 = ER1/OPV
ER3 = ER2 * 100
#Expecting Returns

print ("Total Expecting Returns is",(ER3),"%")




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

https://github.com/bornfreesoul/PythonLessons

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

Monday, June 8, 2020

Python Class 146 (Speed) - Kapil Sharma


print ("*** Application for Speed calaculation Formula ***")

print ("\n")

DV = float(input("Please enter the Distance in meters value:"))
TV = float(input("Please enter the Time taken in hours value:"))

# S = D/T

DV1 = DV/1000

Speed = DV1 / TV 

print ("The total Speed is:" , (Speed), "KM per hrs.")


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

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