Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9161e96

Browse files
Second Day
1 parent 37e254b commit 9161e96

File tree

9 files changed

+606
-5
lines changed

9 files changed

+606
-5
lines changed

‎Conditional_Statments.ipynb‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
},
105105
{
106106
"cell_type": "code",
107-
"execution_count": 14,
107+
"execution_count": 1,
108108
"metadata": {},
109109
"outputs": [
110110
{
@@ -113,10 +113,10 @@
113113
"text": [
114114
"Enter the first Number\n",
115115
"Enter the second Number\n",
116-
"22.0\n",
117-
"354.0\n",
118-
"%\n",
119-
"Result 22.0\n"
116+
"34.0\n",
117+
"345.0\n",
118+
"*\n",
119+
"Result 11730.0\n"
120120
]
121121
}
122122
],
File renamed without changes.
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 3,
6+
"metadata": {},
7+
"outputs": [
8+
{
9+
"name": "stdout",
10+
"output_type": "stream",
11+
"text": [
12+
"ELSE Stmt\n"
13+
]
14+
}
15+
],
16+
"source": [
17+
"a = 3.0\n",
18+
"if a>3:\n",
19+
" print(\"IF Stmt\")\n",
20+
"else:\n",
21+
" print(\"ELSE Stmt\")"
22+
]
23+
},
24+
{
25+
"cell_type": "code",
26+
"execution_count": 7,
27+
"metadata": {},
28+
"outputs": [
29+
{
30+
"name": "stdout",
31+
"output_type": "stream",
32+
"text": [
33+
"Enter the age : \n",
34+
"22\n",
35+
"You can vote\n"
36+
]
37+
}
38+
],
39+
"source": [
40+
"# Voting Program\n",
41+
"age = int(input(print(\"Enter the age : \")))\n",
42+
"print(age)\n",
43+
"if age>=18:\n",
44+
" print(\"You can vote\")\n",
45+
"else:\n",
46+
" print(\"You are Minor\")"
47+
]
48+
},
49+
{
50+
"cell_type": "code",
51+
"execution_count": 9,
52+
"metadata": {},
53+
"outputs": [
54+
{
55+
"name": "stdout",
56+
"output_type": "stream",
57+
"text": [
58+
"Enter Num to check\n",
59+
"3\n",
60+
"ODD\n"
61+
]
62+
}
63+
],
64+
"source": [
65+
"# Even OR Odd check\n",
66+
"num = int(input(print(\"Enter Num to check\")))\n",
67+
"print(num)\n",
68+
"if num%2==0:\n",
69+
" print(\"EVEN\")\n",
70+
"else:\n",
71+
" print(\"ODD\")"
72+
]
73+
},
74+
{
75+
"cell_type": "code",
76+
"execution_count": 10,
77+
"metadata": {},
78+
"outputs": [
79+
{
80+
"name": "stdout",
81+
"output_type": "stream",
82+
"text": [
83+
"Enter Year to check\n",
84+
"2012\n",
85+
"2012 is Leap year\n"
86+
]
87+
}
88+
],
89+
"source": [
90+
"# Leap Year Check\n",
91+
"yr = int(input(print(\"Enter Year to check\")))\n",
92+
"print(yr)\n",
93+
"if yr%4==0:\n",
94+
" if yr%100==0:\n",
95+
" if yr%400:\n",
96+
" print(yr,\" is a Leap year\")\n",
97+
" else:\n",
98+
" print(yr, \"is not Leap year\")\n",
99+
" else:\n",
100+
" print(yr, \"is Leap year\") \n",
101+
"else:\n",
102+
" print(yr, \"is not Leap year\") "
103+
]
104+
},
105+
{
106+
"cell_type": "code",
107+
"execution_count": 14,
108+
"metadata": {},
109+
"outputs": [
110+
{
111+
"name": "stdout",
112+
"output_type": "stream",
113+
"text": [
114+
"Enter the first Number\n",
115+
"Enter the second Number\n",
116+
"22.0\n",
117+
"354.0\n",
118+
"%\n",
119+
"Result 22.0\n"
120+
]
121+
}
122+
],
123+
"source": [
124+
"# Simple Calculator\n",
125+
"num1 = float(input(print(\"Enter the first Number\")))\n",
126+
"num2 = float(input(print(\"Enter the second Number\")))\n",
127+
"operation = input((\"Enter What you want to perform-->(+,-,*,%,/)\"))\n",
128+
"\n",
129+
"if operation==\"+\":\n",
130+
" result = num1+num2\n",
131+
"elif operation==\"-\":\n",
132+
" result = num1-num2\n",
133+
" result = num1+num2\n",
134+
"elif operation==\"*\":\n",
135+
" result = num1*num2\n",
136+
"elif operation==\"%\":\n",
137+
" result = num1%num2\n",
138+
"elif operation==\"/\":\n",
139+
" if num2 != 0:\n",
140+
" result = num1/num2\n",
141+
" else:\n",
142+
" result= \"Error\"\n",
143+
"else:\n",
144+
" result(\"Invalid\")\n",
145+
"print(num1)\n",
146+
"print(num2)\n",
147+
"print(operation)\n",
148+
"print(\"Result\",result)"
149+
]
150+
},
151+
{
152+
"cell_type": "code",
153+
"execution_count": null,
154+
"metadata": {},
155+
"outputs": [],
156+
"source": []
157+
}
158+
],
159+
"metadata": {
160+
"kernelspec": {
161+
"display_name": "base",
162+
"language": "python",
163+
"name": "python3"
164+
},
165+
"language_info": {
166+
"codemirror_mode": {
167+
"name": "ipython",
168+
"version": 3
169+
},
170+
"file_extension": ".py",
171+
"mimetype": "text/x-python",
172+
"name": "python",
173+
"nbconvert_exporter": "python",
174+
"pygments_lexer": "ipython3",
175+
"version": "3.11.7"
176+
}
177+
},
178+
"nbformat": 4,
179+
"nbformat_minor": 2
180+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /