Saturday, May 9, 2020

Python Class 114 - Kapil Sharma

#elif statement example:

from pip._vendor.distlib.compat import raw_input

myInfo = float(raw_input("Please enter the price: "))

if myInfo >= 1000:
    print("Good Price")
elif myInfo <= 1000:
    print("Low Price")
else:

Python Class 11 3 - Kapil Sharma

#If-Statement and it's example:
from pip._vendor.distlib.compat import raw_input
myMoney = ['Dollar', 'Pound', 'Rupee', 'Ruble']
myInfo = raw_input("Which currency you want to buy: ")

if myInfo in myMoney:
    print("Present")
else:
    print("No, currency")
    
#Second Example:
myInfo = 4000

if myInfo>3800:
    print("Good Price")
else:
    print("No, Price")

https://github.com/bornfreesoul/PythonLessons

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

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



Friday, May 8, 2020

Python Class 111 - Kapil Sharma

#List[] is same like Array (series) of random data and its changeable (mutable)
myFoods1 = ["Bread","Wheat","Rice"]
print(myFoods)
print(myFoods[2])
myFoods.append("Garlic")
print(myFoods)
myFoods.pop(1)
print(myFoods)

myFoods2 = ["Bread","Wheat","Rice"]
print(myFoods2[0:2])
print(myFoods2[:1])
print(myFoods2[0:])

#length, maximum, minimum functions
myPhone1 =["Samsung", "Apple", "LG"]
print(myPhone1)
print(len(myPhone1))
print(max(myPhone1))
print(min(myPhone1))
print(sorted(myPhone1))
print(sorted(myPhone1,reverse=True))

#Raw Input feature
from pip._vendor.distlib.compat import raw_input

name1 = raw_input("Please enter your age:")

Python Class 110 - Kapil Sharma


#Printing Strings
print("Hello World!")
#Print Addition
myData1 = 4 + 5
print(myData2)
#Print Subtraction
myData2 = 4 - 5
print(myData2)
#Print Multiply
myData3 = 4 * 5
print(myData3)
#Print Divide
myData4 = 4 / 5
print(myData4)
#Printing Variables
myData5 = 45
print(myData5)
#Printing Float
myData6 = 45.5
print(myData6)
#Printing Alpha Numeric Output
Model_number = 1234098
OEM = "Samsung"
Screen_size = 6.5
Avaiable = True
print("Model Number:",Model_number,"\n","OEM Details:", OEM)

Thursday, May 14, 2015

Python Class 109 - Kapil Sharma

1. while loop: Works till the time condition meet.

2. for loop: works for number of iterations.

3. function: Pre-fabricated code. 
    "def xyz(x): "

4. Class: It's a template of one or multi-functions features and variables.
    Classes can be inherit from super-class to child-class.
    First make class than make its objects to use it's resources.

5. Constructor: Special method in a class. As soon user create object.
    It executed it self, no need to call it.

6. Import: User can import python modules, by using import cmd.
    import xyz > xyz.abc()
    Also, any edit in the import module source file, user needs to,
    reload(xyz) cmd to update the import module in the source code.

7. dir(math) > help(math): This is the way to show help in details.

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

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