Skip to content

Commit fdcb90d

Browse files
committed
update
1 parent 10d28a8 commit fdcb90d

7 files changed

+1849
-21
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 5
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "3e39fc50",
6+
"metadata": {},
7+
"source": [
8+
"## integer"
9+
]
10+
},
11+
{
12+
"cell_type": "code",
13+
"execution_count": 14,
14+
"id": "559dba15",
15+
"metadata": {},
16+
"outputs": [
17+
{
18+
"name": "stdout",
19+
"output_type": "stream",
20+
"text": [
21+
"5\n",
22+
"10\n",
23+
"2\n",
24+
"10\n",
25+
"2.5\n",
26+
"2\n"
27+
]
28+
}
29+
],
30+
"source": [
31+
"i = 5\n",
32+
"\n",
33+
"print(i)\n",
34+
"print(i + 5)\n",
35+
"print(i - 3)\n",
36+
"print(i * 2)\n",
37+
"print(i / 2)\n",
38+
"print(i // 2)"
39+
]
40+
},
41+
{
42+
"cell_type": "markdown",
43+
"id": "87a4836c",
44+
"metadata": {},
45+
"source": [
46+
"## string"
47+
]
48+
},
49+
{
50+
"cell_type": "code",
51+
"execution_count": 11,
52+
"id": "8b8a152a",
53+
"metadata": {},
54+
"outputs": [
55+
{
56+
"name": "stdout",
57+
"output_type": "stream",
58+
"text": [
59+
"welcome to india\n",
60+
"<class 'str'>\n",
61+
"Welcome to india\n",
62+
"Welcome To India\n",
63+
"WELCOME TO INDIA\n",
64+
"welcome to india\n",
65+
"False\n",
66+
"True\n",
67+
"w e l c o m e t o i n d i a\n",
68+
"16\n",
69+
"2\n",
70+
"4\n",
71+
"4\n",
72+
"hello, welcome to india\n",
73+
"welcome to india\n"
74+
]
75+
}
76+
],
77+
"source": [
78+
"s = 'welcome to india'\n",
79+
"\n",
80+
"print(s)\n",
81+
"print(type(s))\n",
82+
"print(s.capitalize())\n",
83+
"print(s.title())\n",
84+
"print(s.upper())\n",
85+
"print(s.lower())\n",
86+
"print(s.isupper())\n",
87+
"print(s.islower())\n",
88+
"print(' '.join(s))\n",
89+
"print(len(s))\n",
90+
"print(s.count('o'))\n",
91+
"print(s.find('o'))\n",
92+
"print(s.index('o'))\n",
93+
"print(f'hello, {s}')\n",
94+
"print(s)"
95+
]
96+
},
97+
{
98+
"cell_type": "code",
99+
"execution_count": null,
100+
"id": "7e8b3ef5",
101+
"metadata": {},
102+
"outputs": [],
103+
"source": []
104+
}
105+
],
106+
"metadata": {
107+
"kernelspec": {
108+
"display_name": "Python 3 (ipykernel)",
109+
"language": "python",
110+
"name": "python3"
111+
},
112+
"language_info": {
113+
"codemirror_mode": {
114+
"name": "ipython",
115+
"version": 3
116+
},
117+
"file_extension": ".py",
118+
"mimetype": "text/x-python",
119+
"name": "python",
120+
"nbconvert_exporter": "python",
121+
"pygments_lexer": "ipython3",
122+
"version": "3.9.12"
123+
}
124+
},
125+
"nbformat": 4,
126+
"nbformat_minor": 5
127+
}

.ipynb_checkpoints/python_functions-checkpoint.ipynb

+113-1
Original file line numberDiff line numberDiff line change
@@ -3537,9 +3537,121 @@
35373537
},
35383538
{
35393539
"cell_type": "code",
3540-
"execution_count": null,
3540+
"execution_count": 1,
35413541
"id": "a8703e11",
35423542
"metadata": {},
3543+
"outputs": [
3544+
{
3545+
"name": "stdout",
3546+
"output_type": "stream",
3547+
"text": [
3548+
"7\n"
3549+
]
3550+
}
3551+
],
3552+
"source": [
3553+
"def hello(x,y):\n",
3554+
" print(x + y + 2)\n",
3555+
" \n",
3556+
"hello(2,3)"
3557+
]
3558+
},
3559+
{
3560+
"cell_type": "code",
3561+
"execution_count": 4,
3562+
"id": "1b0dc79e",
3563+
"metadata": {},
3564+
"outputs": [
3565+
{
3566+
"name": "stdout",
3567+
"output_type": "stream",
3568+
"text": [
3569+
"2 3 HELLO\n"
3570+
]
3571+
}
3572+
],
3573+
"source": [
3574+
"def hello (x,y):\n",
3575+
" print(x + y + 'HELLO')\n",
3576+
" \n",
3577+
"hello('2 ','3 ')"
3578+
]
3579+
},
3580+
{
3581+
"cell_type": "code",
3582+
"execution_count": 5,
3583+
"id": "f05fac9c",
3584+
"metadata": {},
3585+
"outputs": [
3586+
{
3587+
"name": "stdout",
3588+
"output_type": "stream",
3589+
"text": [
3590+
"13\n"
3591+
]
3592+
}
3593+
],
3594+
"source": [
3595+
"x = 5\n",
3596+
"def hello(y, z):\n",
3597+
" print(x + y + z)\n",
3598+
" \n",
3599+
"hello(3, 5)"
3600+
]
3601+
},
3602+
{
3603+
"cell_type": "code",
3604+
"execution_count": 6,
3605+
"id": "98428bb5",
3606+
"metadata": {},
3607+
"outputs": [
3608+
{
3609+
"name": "stdout",
3610+
"output_type": "stream",
3611+
"text": [
3612+
"13\n",
3613+
"5\n"
3614+
]
3615+
}
3616+
],
3617+
"source": [
3618+
"x = 5\n",
3619+
"def hello(y, z):\n",
3620+
" print(x + y + z)\n",
3621+
" \n",
3622+
"hello(3, 5)\n",
3623+
"print(x)"
3624+
]
3625+
},
3626+
{
3627+
"cell_type": "code",
3628+
"execution_count": 16,
3629+
"id": "d8bf1bac",
3630+
"metadata": {},
3631+
"outputs": [
3632+
{
3633+
"name": "stdout",
3634+
"output_type": "stream",
3635+
"text": [
3636+
"enter a name: vishal\n",
3637+
"enter a age: 22\n",
3638+
"enter a mobile: 7887\n",
3639+
"name is : vishal , age is : 22 , mobile : 7887\n"
3640+
]
3641+
}
3642+
],
3643+
"source": [
3644+
"def info(name, age, mobile):\n",
3645+
" print('name is :', name, ', age is :',age, ', mobile :',mobile)\n",
3646+
" \n",
3647+
"info(input('enter a name: ') ,input('enter a age: '), input('enter a mobile: '))"
3648+
]
3649+
},
3650+
{
3651+
"cell_type": "code",
3652+
"execution_count": null,
3653+
"id": "f4838670",
3654+
"metadata": {},
35433655
"outputs": [],
35443656
"source": []
35453657
}

0 commit comments

Comments
 (0)