File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 12
12
print ('Divisible by 2 and not by 3' )
13
13
elif x % 3 == 0 :
14
14
print ('Divisible by 3 and not by 2' )
15
+
16
+
17
+
18
+ # creating a calculator in python using switch statements and function
19
+
Original file line number Diff line number Diff line change
1
+ # simple area of triangle circle and square
2
+
3
+ # area of triangle
4
+ def area_triangle (base , height ):
5
+ return 1 / 2 * base * height
6
+
7
+ # area of circle
8
+ def area_circle (radius ):
9
+ return 3.14 * radius ** 2
10
+
11
+ # area of square
12
+ def area_square (side ):
13
+ return side ** 2
14
+
15
+ # area of rectangle
16
+ def area_rectangle (length , width ):
17
+ return length * width
18
+
19
+ # area of parallelogram
20
+ def area_parallelogram (base , height ):
21
+ return base * height
22
+
Original file line number Diff line number Diff line change
1
+ # string_input=input("Enter a string: ")
2
+ # for i in string_input:
3
+ # if string_input[i] == 'a' or string_input[i]=='e' or string_input[i] == 'i' or string_input[i] == 'o' or string_input[i] == 'u':
4
+ # count += 1
5
+ # print("Number of vowels: " , count)
6
+
7
+
8
+ string_input = input ("Enter a string: " )
9
+ count = 0
10
+ for i in string_input :
11
+ if i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u' :
12
+ count += 1
13
+ print ("Number of vowels: " , count )
14
+
15
+
16
+ for i in range :
17
+ for j in range :
18
+ for k in range :
19
+ print (i ,j ,k )
20
+
21
+ # whats object in python explain with example
22
+
23
+
You can’t perform that action at this time.
0 commit comments