Skip to content

Hw0 жан луи лудвенц лусьяни #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: year22-23
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,117 changes: 1,117 additions & 0 deletions Data_types.ipynb

Large diffs are not rendered by default.

596 changes: 596 additions & 0 deletions HW_0.ipynb

Large diffs are not rendered by default.

418 changes: 404 additions & 14 deletions HW_0/HW_0.ipynb

Large diffs are not rendered by default.

51 changes: 44 additions & 7 deletions week_1/Data_types.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 6,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
Expand All @@ -990,9 +990,31 @@
"id": "XYI5AwfuacTo",
"outputId": "04ecfc14-e257-4538-d588-134533d49c03"
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"veillez saisir un nombre entier179\n",
"17\n"
]
}
],
"source": [
"# Your code"
"# Your code\n",
"# la somme d'un nombre \n",
"# n est le nombre ()\n",
"# demander a la console de saisir un nombre entier \n",
"\n",
"n = int(input(\"veillez saisir un nombre entier\")) \n",
"# creer une variable s = la somme des chiffres \n",
"somme = 0 \n",
"\n",
"while n > 0: \n",
" somme = somme + n % 10\n",
" n = n // 10\n",
" \n",
"print (somme)"
]
},
{
Expand Down Expand Up @@ -1029,14 +1051,29 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 9,
"metadata": {
"id": "B_KtSqfJacTp",
"outputId": "f3583dfe-7332-4e0c-b4e7-3baf66874671"
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"в этот момент:150\n",
"2 ч 30 мин\n"
]
}
],
"source": [
"# Your code"
"# considerons N le nombre de minutes \n",
"# dans 24 h il y a 1440 minutes, количество минут в 24 ч \n",
"\n",
"N = int (input( \"в этот момент:\"))\n",
"N = N % 1440 \n",
"\n",
"print (N//60, \"ч\", N % 60, \"мин\" )"
]
}
],
Expand Down Expand Up @@ -1072,7 +1109,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.9"
"version": "3.9.12"
}
},
"nbformat": 4,
Expand Down
153 changes: 139 additions & 14 deletions week_2/If_Else_While.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -883,10 +883,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1505, 1540, 1575, 1610, 1645, 1680, 1715, 1750, 1785, 1820, 1855, 1890, 1925, 1960, 1995, 2030, 2065, 2100, 2135, 2170, 2205, 2240, 2275, 2310, 2345, 2380, 2415, 2450, 2485, 2520, 2555, 2590, 2625, 2660, 2695, "
]
}
],
"source": [
"for nombre in range(1500,2700): \n",
" if (nombre % 7 == 0) and (nombre % 5 == 0): \n",
" print (nombre , end = \", \")"
]
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -915,10 +927,40 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"enter the number of lines: 5\n",
"* \n",
"* * \n",
"* * * \n",
"* * * * \n",
"* * * * * \n",
"* * * * \n",
"* * * \n",
"* * \n",
"* \n",
"\n"
]
}
],
"source": [
"# the left pascal's pattern\n",
"# n = number of lines \n",
"n = int(input(\"enter the number of lines: \"))\n",
"for i in range(n): \n",
" for j in range(i+1): \n",
" print(\"*\", end= \" \")\n",
" print()\n",
"for i in range(n):\n",
" for j in range(i+1,n):\n",
" print(\"*\", end= \" \")\n",
" print ()"
]
},
{
"cell_type": "markdown",
Expand All @@ -938,10 +980,33 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 41,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"1\n",
"2\n",
"4\n",
"5\n"
]
}
],
"source": [
"# make a variable blacklist for 3 and 6\n",
"# x is a number between (0,7) \n",
"\n",
"x = 0 \n",
"blacklist = [3,6]\n",
"\n",
"for x in range(0,7):\n",
" if x in blacklist:\n",
" continue\n",
" print (x)\n"
]
},
{
"cell_type": "markdown",
Expand All @@ -967,10 +1032,34 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 35,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"enter the value of the first side of the triangle:6\n",
"enter the value of the seconde side of the triangle:8\n",
"enter the value of the third side of the triangle:12\n",
"Scalene triangle\n"
]
}
],
"source": [
"x = int(input(\"enter the value of the first side of the triangle:\"))\n",
"y = int(input(\"enter the value of the seconde side of the triangle:\"))\n",
"z = int(input(\"enter the value of the third side of the triangle:\"))\n",
"\n",
"if x == y == z and z==x: \n",
" print(\"Equilateral triangle\")\n",
" \n",
"elif x != y != z: \n",
" print(\"Scalene triangle\")\n",
"else: \n",
" x == y or y ==z or x ==z \n",
" print(\"Isosceles triangle\")"
]
},
{
"cell_type": "markdown",
Expand All @@ -993,6 +1082,42 @@
"`The next date is [yyyy-mm-dd] 2016-8-24` "
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Enter a year:2016\n",
"Enter a month:08\n",
"Enter a day:23\n",
"The next date is 2016 8 24\n"
]
}
],
"source": [
"y = int(input(\"Enter a year:\"))\n",
"m = int(input(\"Enter a month:\"))\n",
"d = int(input(\"Enter a day:\"))\n",
"\n",
"if (y %4 == 0) and ( m == 2):\n",
" print (\"The next date is\", y, m, d+1)\n",
"elif (y %4 != 0) and (m==2):\n",
" print (\"The next date is\", y, m+1, d//d)\n",
"elif m!= 2 and d==30: \n",
" print (\"The next date is\", y, m+1, d//d)\n",
"elif d == 31 and d!=31: \n",
" print (\"The next date is\", y, m+1,d//d)\n",
"elif m != 2 and d<31:\n",
" print (\"The next date is\", y, m, d+1)\n",
"else: \n",
" (m==12) and (d==31)\n",
" print (\"The next date is\", y+1, m//m, d//d)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -1008,7 +1133,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -1022,7 +1147,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.12"
}
},
"nbformat": 4,
Expand Down
24 changes: 19 additions & 5 deletions week_2/Strings_Input.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2969,11 +2969,25 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 7,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"What is your name:Ludventz \n",
"How old are you:24\n",
"Ludventz will be 100 years old in the year 2098\n"
]
}
],
"source": [
"# Your code"
"# Your code\n",
"name = input( \"What is your name:\")\n",
"age = int(input(\"How old are you:\"))\n",
"\n",
"print (name, \"will be 100 years old in the year\",(100 + 2022)-age )\n"
]
},
{
Expand All @@ -2994,7 +3008,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -3008,7 +3022,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.12"
}
},
"nbformat": 4,
Expand Down
Loading