Skip to content

Commit 6fd54e5

Browse files
authored
Add files via upload
1 parent bba6bb4 commit 6fd54e5

33 files changed

+338
-0
lines changed

Module 2/1.1 Arithmetic Operator.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
print(5+5)
2+
print(2-6)
3+
print(7*2)
4+
print(2/10)
5+
print("python"+"3")
6+
print(10//3)
7+
print(5%50)
8+
print(10%50)
9+
print(10%50)
10+
print(+3)
11+
print(-3)
12+
a=10
13+
print(-a)
14+
print(+a)

Module 2/10.1 Inverting Booleans.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
V=False
2+
3+
print(V is False)
4+
print(not V)
5+
V1=True
6+
V=not V1
7+
print(V)

Module 2/11.1 bitwise operator.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
print(4&5)
2+
print(4|5)
3+
print(~4)
4+
print(4^6)
5+
6+
a=10
7+
b=9
8+
c=0
9+
c=a&b
10+
print("This and Bitwise operator",c)
11+
c=a|b
12+
print("This is Or bitwise operator",c)
13+
14+
c=a<<2;
15+
print(c)
16+
c=a>>2;
17+
print(c)

Module 2/2.1 assignment operators.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
a=10
2+
a=a+1
3+
print(a)
4+
a+=1
5+
print(a)
6+
b=10
7+
c=0
8+
c=b=a
9+
print(c)
10+
x=3
11+
x*=2
12+
print(x)
13+
y=3
14+
y/=6
15+
print(y)
16+
z=10
17+
z<=y
18+
print(z)

Module 2/3.1 Calculate Average.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
avg=(5+9+6)/3
2+
print(avg)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var=2
2+
3+
var+=10
4+
print(var)
5+
var*=10
6+
print(var)
7+
var/=10
8+
print(var)
9+
var-=10
10+
11+
print(var)

Module 2/6.1 Comparison Operators.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
print(2==2)
2+
print(2==3)
3+
print(2!=3)
4+
print(2!=2)
5+
print(2>3)
6+
print(2>=3)
7+
print(2<3)
8+
print(2<=3)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
rest="Clean"
2+
count=5
3+
is_clean=rest=="Clean"
4+
is_count=count==6
5+
is_not_clean=rest!="Clean"
6+
print(is_clean)
7+
print(is_count)
8+
print(is_not_clean)
9+
print(4!=5)
10+
print(4==5)

Module 2/8.1 logical Operator.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
a=True
2+
b=True
3+
print("a AND B",a and b)
4+
print("a or B",a or b)
5+
print("a not ", not a)

Module 2/9.1 is isnot operator.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var=None
2+
car="BMW"
3+
4+
is_none=var is None
5+
is_not_none=car is not "White"

Module 3/1.1 If Statement.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#age=14
2+
#if age<16:
3+
# print("you are not Able to registor an account")
4+
5+
price=20
6+
qty=15
7+
amount=price*qty
8+
if amount>100:
9+
print("15% of discount on that")
10+
discount=amount*15/100
11+
amount=amount-discount
12+
print("amount payble",amount)
13+
14+
var1=None
15+
if True:
16+
var1="hi Python"
17+
print(var1)

Module 3/10.1 nested loop.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
for num in range(3):
2+
for num1 in range(5,9):
3+
print(num,",",num1)
4+
print("++++++++++++")
5+
a=1
6+
b=4
7+
while a<2:
8+
while b<5:
9+
print(a,",",b)
10+
b=b+1
11+
a=a+1
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
for a in range(5):
2+
print(a)
3+
else:
4+
print("The loop has completed execution")
5+
6+
print("_______________________")
7+
t=0
8+
n=10
9+
while (n<=10):
10+
t=t+n
11+
n=n+1
12+
print("Value of total while loop is",t)
13+
else:
14+
print("You have value is equal to 10")

Module 3/13.1 Fibonacci Series.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
number=12
2+
i=0
3+
val1=0
4+
val2=1
5+
while(i<number):
6+
if(i<=1):
7+
next=i
8+
else:
9+
next=val1+val2
10+
val1=val2
11+
val2=next
12+
13+
print(next)
14+
i=i+1

Module 3/2.1 Else statmenet.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#a=10
2+
#b=15
3+
#if b<a:
4+
#print("B is greater then A")
5+
#else:
6+
# print
7+
8+
price=15
9+
qty=20
10+
amount=price*qty
11+
if amount<100:
12+
print("15% discount")
13+
discount=amount*15/100
14+
amount=amount-discount
15+
print("amount payble",amount)
16+
else:
17+
print("5% discount ")
18+
discount=amount*5/100
19+
amount=amount-discount
20+
print("amount payble",amount)

Module 3/3.1 elif statement.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
x=2
2+
if x==1:
3+
print("X is 1")
4+
elif x==4:
5+
print("X is 4")
6+
7+
elif x==5:
8+
print("X is 5")
9+
else:
10+
print("X is something Else")
11+
print("=====================")
12+
price=60
13+
qty=10
14+
amount=price*qty
15+
16+
if amount>500:
17+
print("15% discount is given")
18+
discount=amount*15/100
19+
amount=amount-discount
20+
print("this payble amount is ",amount)
21+
elif amount>400:
22+
print("10 % discount id given")
23+
discount = amount * 10 / 100
24+
amount = amount - discount
25+
print("this payble amount is ", amount)
26+
27+
else:
28+
print("No discount Given")

Module 3/5.1 nested if else.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var=-10
2+
if var>0:
3+
print("Postive Number")
4+
else:
5+
print("Negative Number")
6+
if -10<=var:
7+
print("Two Digit are Negative")

Module 3/7.1 for loop.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
programming_language="C++","Python","PHP"
2+
for P in programming_language:
3+
print(P)
4+
number=0
5+
for val in range(1,7):
6+
number=number+val
7+
8+
print(number)

Module 3/8.1 while loop.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
x=5
2+
while(x<5):
3+
print(x)
4+
x+=1
5+
print(x)
6+
total=0
7+
num=20
8+
while (num<=25):
9+
total=total+num
10+
num=num+1
11+
print("Value of the total from the while loop",total)

Module 3/9.1 Break and Continue.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
for char in "Python3":
2+
if(char =="o"):
3+
break
4+
print("Character",char)
5+
6+
for char in "Python3":
7+
if(char =="o"):
8+
continue
9+
print("Character",char)
10+
11+
for char in "Python3":
12+
if(char =="o"):
13+
pass
14+
print("Character",char)

Module 3/tempCodeRunnerFile.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
programming_language="C++","Python","PHP"
2+
for P in programming_language:
3+
print(P)
4+
number=0
5+
for val in range(1,7):
6+
number=number+val
7+
8+
print(number)

Module 4/1.1 Functions.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def LMS():
2+
print("Books")
3+
print("Author")
4+
print("Student")
5+
print("Staff")
6+
7+
LMS()
8+
print("_______________")
9+
def avg():
10+
x=3
11+
y=5
12+
print("Avarage of ",x,"and",y,"is",(x+y)/2)
13+
avg()

Module 4/3.1 Functions.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def LMS():
2+
print("Books")
3+
print("Author")
4+
print("Student")
5+
print("Staff")
6+
7+
LMS()
8+
print("_______________")
9+
def avg():
10+
x=3
11+
y=5
12+
print("Avarage of ",x,"and",y,"is",(x+y)/2)
13+
avg()

Module 4/4.1 nested function.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
def outerfunction():
2+
print("hello i am outer funtion")
3+
def innerfunction():
4+
print("hello i am inner function")
5+
innerfunction()
6+
outerfunction()
7+
8+
print("____________-")
9+
def num(x):
10+
def num1(y):
11+
return x*y
12+
return num1
13+
result=num(20)
14+
print(result(2))

Module 4/5.1 Module.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import math
2+
print("Thie value of tangent is",math.tan(3))
3+
print("Thie value of sine is",math.sin(3))

Module 5/10.1 taking a user input.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
print("Enter you Name")
2+
i=input()
3+
print('hello'+i)

Module 5/2.1 negitive index.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
var="hello world"
2+
print(var[-2])

Module 5/3.1 slicing.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
str="hello world"
2+
s1=slice(3)
3+
s2=slice(1,3,2)
4+
print("python programming")
5+
print(str[s1])
6+
print(str[s2])

Module 5/5.1 append.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
list=[20,30,50,60,80,90]
2+
print(list)
3+
list.append(10)
4+
print (list)

Module 5/6.1 string formatting.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
var="for Only In {price:2f} Dollars"
2+
print(var.format(price=100))

Module 5/7.1 index and slicing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
a="ABCDEFGHI"
2+
print("a[-4]= %s" % a[-4])
3+
print("a[5]= %s" % a[5])
4+
print("a[1:3]=%s" % a[1:3])

Module 5/8.1 Neutralize Uppercase.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
def upper1(str):
2+
uppervar=0
3+
for i in str[:4]:
4+
if i.upper()==i:
5+
uppervar+=1
6+
if uppervar>=2:
7+
return str.upper()
8+
return str
9+
10+
print(upper1("PyThon"))
11+
12+
var2="Python code"
13+
print(var2.capitalize())
14+
name="Python"
15+
name2="code"
16+
print(name.capitalize())
17+
print(name2.capitalize())

Module 5/9.1 max character.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
var=max("python")
2+
print(var)
3+
var2=max(10,20,50,80,90)
4+
print(var2)
5+
6+
7+
8+

0 commit comments

Comments
 (0)