Skip to content

Commit 5514bd9

Browse files
Documentaion For Some Codes aare Updated
Documentaion For Some Codes aare Updated with some comment for better Code-Reading.
1 parent 432f747 commit 5514bd9

21 files changed

+135
-86
lines changed

Control Flow/Loop 3.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"""
33
Created on Mon Oct 28 17:17:30 2019
44
5-
@author: Looping Example 2
5+
@author: codePerfectPlus
6+
7+
Looping Example 2
68
"""
79

810
Phone = ['Iphone 10', 'Samsung S10', 'One plus 7 pro', 'Redmi note 7 pro']

Functions/Basic Function Introduction.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
'''
77

88
def check_number(x):
9-
if (x % 2 == 0):
10-
print("Given Number Is Even")
9+
if (x % 2 == 0): # checking Divisibility by 2
10+
print("Given Number Is Even") # 2,4,6,8....
1111

1212
else:
13-
print("Given Number Is Odd")
13+
print("Given Number Is Odd") #1,3,5,7...
1414

1515
check_number(7)
1616
check_number(5)
@@ -21,4 +21,6 @@ def check_number(x):
2121
def student_name(firstname,lastname):
2222
print(firstname, lastname)
2323

24-
student_name(firstname = 'Alex', lastname = 'Jean')
24+
25+
student_name("john","adam")
26+
student_name(lastname = 'Jean',firstname = 'Alex',)

Functions/Function_extended.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
'''
2+
Check you name contain vowel Or Not Using python intersection function.
3+
'''
4+
15
def names():
2-
name = str(input("Please! Enter Your Name"))
6+
name = input("Please! Enter Your Name\n") #Enter Your name
37

48
if set('aeiou').intersection(name.lower()):
59
print("Your Name Contains a vowel")
610
else :
711
print("Your Name doesn't have a vowel")
812

9-
for letter in names:
13+
for letter in name: # For Loop To Check Letter
1014
print(letter)
15+
1116

1217
names()

Numpy/Basic Operation_numpy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'''
2+
@author : CodePerfectplus
23
we can use arithmatic operators to do elementwise operation on array to convert in a new array.
34
Arithmatic Operaqtors
45

Numpy/std Deviation.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'''
2+
Standard deviation is a number that describes how spread out the values are.
3+
A low standard deviation means that most of the numbers are close to the mean (average) value.
4+
A high standard deviation means that the values are spread out over a wider range.
5+
Example: This time we have registered the speed of 7 cars:
6+
'''
7+
import numpy
8+
9+
speed = [86,87,88,86,87,85,86]
10+
11+
x = numpy.std(speed)
12+
13+
print(x)

Pandas/Create Pandas Dataframe.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
# import pandas Library
2-
1+
'''
2+
import pandas Library
3+
Pandas is Python Library for dataframe, Like to read write and load data in dataframe.
4+
Pandas is must known library for Data Science.
5+
'''
36
import numpy as np
47
import pandas as pd
58

Pandas/Pandas Indexing and slicing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"""
33
Created on Wed Oct 23 17:42:13 2019
44
5-
@author: Indexing and Selecting Data with Pandas
5+
@author: CodePerfectPlus
6+
@Topic : Indexing and Selecting Data with Pandas
67
"""
78
import pandas as pd
89
df = pd.read_csv('nba.csv', index_col = "Name")

Pandas/creating pandas dataframe from list using dictionary.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
'''
2+
Cretae Data Frame Using Dictionary in python.
3+
Dictionary is a (key-value) Pair Data Type in python.
4+
'''
5+
16
import pandas as pd
27

38
dict ={ 'Name':['john', 'joe', 'Alex', 'Iris', 'berry'],

Python Projects/Compound Interest.py

Whitespace-only changes.

Python Projects/Find n-th Fiboncci Number.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# a = (a-1) + (a-2)
2-
3-
# recurssion mehthod
4-
1+
'''
2+
Fibonacci Series start from 1. it makes new number by adding previous 2 Numbers.
3+
1,1,2,3,5
4+
'''
55
def Fibonacci(n):
66
if n<0:
77
print("Wrong Input ! Please Check Again")

0 commit comments

Comments
 (0)