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

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