Skip to content

Commit e539ed6

Browse files
Add files via upload
0 parents  commit e539ed6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+492
-0
lines changed

pr10_1upperlowercase.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
def string_test(s):
2+
d={"UPPER_CASE":0, "LOWER_CASE":0}
3+
for c in s:
4+
if c.isupper():
5+
d["UPPER_CASE"]+=1
6+
elif c.islower():
7+
d["LOWER_CASE"]+=1
8+
else:
9+
pass
10+
print ("Original String : ", s)
11+
print ("No. of Upper case characters : ", d["UPPER_CASE"])
12+
print ("No. of Lower case Characters : ", d["LOWER_CASE"])
13+
14+
string_test('My name is Stuti Gujarathi')

pr10_2randomfloat.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import random
2+
for x in range(6):
3+
print('{:04.3f}'.format(random.uniform(x, 100)), end=' ')

pr11_1primeornot.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
def test_prime(n):
2+
if (n==1):
3+
return False
4+
elif (n==2):
5+
return True;
6+
else:
7+
for x in range(2,n):
8+
if(n % x==0):
9+
return False
10+
return True
11+
print(test_prime(14))

pr11_2factorial.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def factorial(n):
2+
if n == 0:
3+
return 1
4+
else:
5+
return n * factorial(n-1)
6+
n=int(input("Input a number to compute the factiorial : "))
7+
print(factorial(n))

pr12_1college.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import file;
2+
name = input("Enter the College name:")
3+
file.displayMsg(name)

pr12_3calendar.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import calendar
2+
yy=2021
3+
mm=7
4+
print(calendar.month(yy,mm))

pr12_circlearea.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import math
2+
radius = float(input("Enter radius of circle: "))
3+
area = radius*radius* math.pi
4+
cir=math.pi*2*radius
5+
print(" Area Of a Circle = ",area)
6+
print(" circumference Of a Circle = ",cir)

pr13_1arithmatic.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import numpy
2+
# Two matrices are initialized by value
3+
x = numpy.array([[1, 2], [4, 5]])
4+
y = numpy.array([[7, 8], [9, 10]])
5+
# add()is used to add matrices
6+
print ("Addition of two matrices: ")
7+
print (numpy.add(x,y))
8+
# subtract()is used to subtract matrices
9+
print ("Subtraction of two matrices : ")
10+
print (numpy.subtract(x,y))
11+
# divide()is used to divide matrices
12+
print ("Matrix Division : ")
13+
print (numpy.divide(x,y))
14+
print ("Multiplication of two matrices: ")
15+
print (numpy.multiply(x,y))

pr1_version.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import sys
2+
print("Python Version")
3+
print(sys.version)
4+
print("Version info.")
5+
print(sys.version_info)

pr2_msbte.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print('MSBTE')

0 commit comments

Comments
 (0)