Skip to content

Commit dc8b553

Browse files
author
JainMaster
authored
Add files via upload
1 parent 4c43f30 commit dc8b553

File tree

1 file changed

+190
-0
lines changed

1 file changed

+190
-0
lines changed

1.Introduction to Python.ipynb

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Find average Marks"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"<br><b>Write a program to input marks of three tests of a student (all integers). Then calculate and print the average of all test marks.</b>\n",
15+
"<br><b>Input format :</b>\n",
16+
"<br>3 Test marks (in different lines)\n",
17+
"<br><b>Output format :</b>\n",
18+
"<br>Average\n",
19+
"<br><b>Sample Input 1 :</b>\n",
20+
"<br>3\n",
21+
"<br>4 \n",
22+
"<br>6\n",
23+
"<br><b>Sample Output 1 :</b>\n",
24+
"<br>4.333333333333333\n",
25+
"<br><b>Sample Input 2 :</b>\n",
26+
"<br>5 \n",
27+
"<br>10 \n",
28+
"<br>5\n",
29+
"<br><b>Sample Output 2 :</b>\n",
30+
"<br>6.666666666666667"
31+
]
32+
},
33+
{
34+
"cell_type": "code",
35+
"execution_count": null,
36+
"metadata": {},
37+
"outputs": [],
38+
"source": [
39+
"sub_1=int(input(\"\"))\n",
40+
"sub_2=int(input(\"\"))\n",
41+
"sub_3=int(input(\"\"))\n",
42+
"Average_of_3_subjects=(sub_1+sub_2+sub_3)\n",
43+
"print(Average_of_3_subjects/3)"
44+
]
45+
},
46+
{
47+
"cell_type": "markdown",
48+
"metadata": {},
49+
"source": [
50+
"# Find X raised to power N"
51+
]
52+
},
53+
{
54+
"cell_type": "markdown",
55+
"metadata": {},
56+
"source": [
57+
"<br><b>You are given two integers: X and N. You have to calculate X raised to power N and print it.</b>\n",
58+
"<br><b>Input format:</b>\n",
59+
"<br>The first line of input contains an integer X (1 <= X <= 100)\n",
60+
"<br>The second line of input contains an integer N (1 <= N <= 10) \n",
61+
"<br><b>Constraints:</b>\n",
62+
"<br>Time Limit: 1 second\n",
63+
"<br><b>Output format:</b>\n",
64+
"<br>The first and only line of output contains the result. \n",
65+
"<br><b>Sample Input:</b>\n",
66+
"<br>10\n",
67+
"<br>4\n",
68+
"<br><b>Sample Output:</b>\n",
69+
"<br>10000"
70+
]
71+
},
72+
{
73+
"cell_type": "code",
74+
"execution_count": null,
75+
"metadata": {},
76+
"outputs": [],
77+
"source": [
78+
"X=int(input())\n",
79+
"N=int(input())\n",
80+
"\n",
81+
"print(X**N)"
82+
]
83+
},
84+
{
85+
"cell_type": "markdown",
86+
"metadata": {},
87+
"source": [
88+
"# Arithmetic Progression"
89+
]
90+
},
91+
{
92+
"cell_type": "markdown",
93+
"metadata": {},
94+
"source": [
95+
"<br><b>You are given first three entries of an arithmetic progression. You have to calculate the common difference and print it.</b>\n",
96+
"<br><b>Input format:</b>\n",
97+
"<br>The first line of input contains an integer a (1 <= a <= 100)\n",
98+
"<br>The second line of input contains an integer b (1 <= b <= 100) \n",
99+
"<br>The third line of input contains an integer c (1 <= c <= 100) \n",
100+
"<br><b>Constraints:</b>\n",
101+
"<br>Time Limit: 1 second\n",
102+
"<br><b>Output format:</b>\n",
103+
"<br>The first and only line of output contains the result. \n",
104+
"<br><b>Sample Input:</b>\n",
105+
"<br>1\n",
106+
"<br>3\n",
107+
"<br>5\n",
108+
"<br><b>Sample Output:</b>\n",
109+
"<br>2"
110+
]
111+
},
112+
{
113+
"cell_type": "code",
114+
"execution_count": null,
115+
"metadata": {},
116+
"outputs": [],
117+
"source": [
118+
"a=int(input())\n",
119+
"b=int(input())\n",
120+
"c=int(input())\n",
121+
"print(b-a)\n"
122+
]
123+
},
124+
{
125+
"cell_type": "markdown",
126+
"metadata": {},
127+
"source": [
128+
"# Rectangular Area"
129+
]
130+
},
131+
{
132+
"cell_type": "markdown",
133+
"metadata": {},
134+
"source": [
135+
"<br><b>You are given a rectangle in a plane. The corner coordinates of this rectangle is provided to you. You have to print the amount of area of the plane covered by this rectangles.</b>\n",
136+
"<br>The end coordinates are provided as four integral values: x1, y1, x2, y2. It is given that x1 < x2 and y1 < y2.\n",
137+
"<br><b>Input format:</b>\n",
138+
"<br>The first line of input contains an integer x1 (1 <= x1 <= 10)\n",
139+
"<br>The second line of input contains an integer y1 (1 <= y1 <= 10) \n",
140+
"<br>The third line of input contains an integer x2 (1 <= x2 <= 10)\n",
141+
"<br>The fourth line of input contains an integer y2 (1 <= y2 <= 10) \n",
142+
"<br><b>Constraints:</b>\n",
143+
"<br>Time Limit: 1 second\n",
144+
"<br><b>Output format:</b>\n",
145+
"<br>The first and only line of output contains the result.\n",
146+
"<br><b>Sample Input:</b>\n",
147+
"<br>1\n",
148+
"<br>1\n",
149+
"<br>3\n",
150+
"<br>3\n",
151+
"<br><b>Sample Output:</b>\n",
152+
"<br><br>4"
153+
]
154+
},
155+
{
156+
"cell_type": "code",
157+
"execution_count": null,
158+
"metadata": {},
159+
"outputs": [],
160+
"source": [
161+
"x1=int(input())\n",
162+
"y1=int(input())\n",
163+
"x2=int(input())\n",
164+
"y2=int(input())\n",
165+
"print((x2-x1)*(y2 - y1))"
166+
]
167+
}
168+
],
169+
"metadata": {
170+
"kernelspec": {
171+
"display_name": "Python 3",
172+
"language": "python",
173+
"name": "python3"
174+
},
175+
"language_info": {
176+
"codemirror_mode": {
177+
"name": "ipython",
178+
"version": 3
179+
},
180+
"file_extension": ".py",
181+
"mimetype": "text/x-python",
182+
"name": "python",
183+
"nbconvert_exporter": "python",
184+
"pygments_lexer": "ipython3",
185+
"version": "3.8.6"
186+
}
187+
},
188+
"nbformat": 4,
189+
"nbformat_minor": 4
190+
}

0 commit comments

Comments
 (0)