Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aurdino
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
B.Nagasuman
aurdino
Commits
9b221e1b
Commit
9b221e1b
authored
Jun 07, 2019
by
B.Nagasuman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
4d51af57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
340 additions
and
0 deletions
+340
-0
10.ipynb
10.ipynb
+340
-0
No files found.
10.ipynb
0 → 100644
View file @
9b221e1b
{
"cells": [
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"enter a number\t7\n",
"entered number is 7.0\n",
"the difference between 21 and7.0 is\t 14.0\n"
]
}
],
"source": [
"n=float(input(\"enter a number\\t\"))\n",
"print(\"entered number is \" + str(n))\n",
"if n<=21:\n",
" print(\"the difference between 21 and\" + str(n) + \" is\\t \" + str(21-n) )\n",
"else:\n",
" print(\"the double of difference between \" +str(n)+ \" and 21 is: \")\n",
" print(2*(n-21))"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"enter a number201\n",
"false\n"
]
}
],
"source": [
"n=float(input(\"enter a number\"))\n",
"if n<=100 and 100-n>10:\n",
" print(\"true\")\n",
"elif n<=200 and 200-n<=10:\n",
" print(\"true\")\n",
"else:\n",
" print(\"false\")"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"enter any string\tcutie\n",
"enter the index value to be removed\t3\n",
"c\n",
"cu\n",
"cut\n",
"cute\n"
]
}
],
"source": [
"a=str(input(\"enter any string\\t\"))\n",
"n=int(input(\"enter the index value to be removed\\t\"))\n",
"t=len(a)\n",
"if n<=t-1:\n",
" b=\"\"\n",
" for i in range (t):\n",
" if i==n:\n",
" continue\n",
" else:\n",
" b=b+a[i]\n",
" print(b)\n",
"else:\n",
" print(\"index value is out of range.please check.\")\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"enter the first number\t21\n",
"enter the second number\t21\n",
"1764.0\n"
]
}
],
"source": [
"x=float(input(\"enter the first number\\t\"))\n",
"y=float(input(\"enter the second number\\t\"))\n",
"if x==y:\n",
" print((2*x)**2)\n",
"else:\n",
" print(x+y)\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"enter any string\tyashu\n",
"enter the number3\n",
"yashuyashuyashu\n"
]
}
],
"source": [
"a=str(input(\"enter any string\\t\"))\n",
"b=int(input(\"enter the number\"))\n",
"print(a*b)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"enter the range\t45\n",
"[0]\n",
"[1]\n",
"number of even numbers\t1\n",
"number of odd numbers\t1\n",
"[0, 2]\n",
"[1, 3]\n",
"number of even numbers\t2\n",
"number of odd numbers\t2\n",
"[0, 2, 4]\n",
"[1, 3, 5]\n",
"number of even numbers\t3\n",
"number of odd numbers\t3\n",
"[0, 2, 4, 6]\n",
"[1, 3, 5, 7]\n",
"number of even numbers\t4\n",
"number of odd numbers\t4\n",
"[0, 2, 4, 6, 8]\n",
"[1, 3, 5, 7, 9]\n",
"number of even numbers\t5\n",
"number of odd numbers\t5\n",
"[0, 2, 4, 6, 8, 10]\n",
"[1, 3, 5, 7, 9, 11]\n",
"number of even numbers\t6\n",
"number of odd numbers\t6\n",
"[0, 2, 4, 6, 8, 10, 12]\n",
"[1, 3, 5, 7, 9, 11, 13]\n",
"number of even numbers\t7\n",
"number of odd numbers\t7\n",
"[0, 2, 4, 6, 8, 10, 12, 14]\n",
"[1, 3, 5, 7, 9, 11, 13, 15]\n",
"number of even numbers\t8\n",
"number of odd numbers\t8\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17]\n",
"number of even numbers\t9\n",
"number of odd numbers\t9\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19]\n",
"number of even numbers\t10\n",
"number of odd numbers\t10\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21]\n",
"number of even numbers\t11\n",
"number of odd numbers\t11\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23]\n",
"number of even numbers\t12\n",
"number of odd numbers\t12\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25]\n",
"number of even numbers\t13\n",
"number of odd numbers\t13\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27]\n",
"number of even numbers\t14\n",
"number of odd numbers\t14\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29]\n",
"number of even numbers\t15\n",
"number of odd numbers\t15\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31]\n",
"number of even numbers\t16\n",
"number of odd numbers\t16\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33]\n",
"number of even numbers\t17\n",
"number of odd numbers\t17\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35]\n",
"number of even numbers\t18\n",
"number of odd numbers\t18\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37]\n",
"number of even numbers\t19\n",
"number of odd numbers\t19\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39]\n",
"number of even numbers\t20\n",
"number of odd numbers\t20\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41]\n",
"number of even numbers\t21\n",
"number of odd numbers\t21\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43]\n",
"number of even numbers\t22\n",
"number of odd numbers\t22\n",
"[0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44]\n",
"[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45]\n",
"number of even numbers\t23\n",
"number of odd numbers\t23\n"
]
}
],
"source": [
"even=[]\n",
"odd=[]\n",
"n=int(input(\"enter the range\\t\"))\n",
"for i in range(n+1):\n",
" if i%2==0:\n",
" even.append(i)\n",
" else:\n",
" odd.append(i)\n",
" print(even)\n",
" print(odd)\n",
" t=len(even)\n",
" q=len(odd)\n",
" print(\"number of even numbers\\t\"+str(t))\n",
" print(\"number of odd numbers\\t\"+str(t))\n"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<built-in function time>\n"
]
}
],
"source": [
"import time\n",
"currentT=time.time\n",
"print(currentT)\n"
]
},
{
"cell_type": "code",
"execution_count": 54,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Enter the values :5\n",
"Enter the values :7\n",
"false\n"
]
}
],
"source": [
"\n",
"a=int(input(\"Enter the values :\"))\n",
"b=int(input(\"Enter the values :\"))\n",
"if (a==10)or(a+b==10)or(b==10):\n",
" print(\"true\")\n",
"else:\n",
" print(\"false\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3rc1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment