diff --git a/AungYeKyaw/AungYeKyaw__Ex1_Python.ipynb b/AungYeKyaw/AungYeKyaw__Ex1_Python.ipynb
new file mode 100644
index 0000000..cf34e9f
--- /dev/null
+++ b/AungYeKyaw/AungYeKyaw__Ex1_Python.ipynb
@@ -0,0 +1,495 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "thgO68_HZ0Aa"
+ },
+ "source": [
+ "# Introduction"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "PIh3i0c_Z_yP"
+ },
+ "source": [
+ "This section introduces the Python Programming uisng Colab. Follow the instructions and complete the exercises."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "gCw6SfeFZ78l"
+ },
+ "source": [
+ "# Ex 1 : Check Version"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "6Vm-27iLabjm"
+ },
+ "source": [
+ "Using the below cell, Import the required library and check the version of the python in your environment."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "PJDYHB4AXVdc",
+ "outputId": "f0953f11-2ec8-4164-872a-f28ab5d25d1b",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 37
+ }
+ },
+ "outputs": [
+ {
+ "output_type": "execute_result",
+ "data": {
+ "text/plain": [
+ "'3.11.12 (main, Apr 9 2025, 08:55:54) [GCC 11.4.0]'"
+ ],
+ "application/vnd.google.colaboratory.intrinsic+json": {
+ "type": "string"
+ }
+ },
+ "metadata": {},
+ "execution_count": 1
+ }
+ ],
+ "source": [
+ "import sys\n",
+ "sys.version\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "5qTEiwGlawf5"
+ },
+ "source": [
+ "# Ex2 : Convert Currency."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "XH8K1p0ypVCg"
+ },
+ "source": [
+ "Write a program that asks the user for the amount in usd and converts it to British pounds. The exchange rate is from usd to BP is given as 0.82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ },
+ "id": "x9xQXOnRa0MS",
+ "outputId": "c6abb660-ee9c-494d-dc61-c24e00c4c8a5"
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Enter the amount in USD: 5000\n",
+ "5000 usd is equivalent to 4100.0 british pound\n"
+ ]
+ }
+ ],
+ "source": [
+ "usd_amount = input (\"Enter the amount in USD: \")\n",
+ "bp_amount = int(usd_amount) *0.82\n",
+ "print(\"{} usd is equivalent to {} british pound\".format(usd_amount, bp_amount))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "ePfECwUIpli4"
+ },
+ "source": [
+ "# Ex 3: Temperature Converter"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "Y60hUWDsp3pK"
+ },
+ "source": [
+ "Write a program that convert temperature in Feranhite to celsius."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "G9PbO6qPoUfn",
+ "outputId": "6f82f657-94fa-42b4-9d40-be5058868c06",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ }
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Enter the Feranhite35\n",
+ "35 F is equal to 1.6666666666666667 C\n"
+ ]
+ }
+ ],
+ "source": [
+ "feranhite_value = int (input (\"Enter the Feranhite\"))\n",
+ "celsius = (feranhite_value-32)*5/9\n",
+ "print(\"{} F is equal to {} C\".format(feranhite_value,celsius))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "a2kNRO9Vp7Qz"
+ },
+ "source": [
+ "# Ex 4: Daily Maths"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "lItKon9qqEUn"
+ },
+ "source": [
+ "You are working in a retail shop. Write a program that computes the total cost for a customer that bought 3 differnt types of fruits : apple, orange, mango. Ask the user to enter the quantity and price for each type."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "mIQFjH6wqDma",
+ "outputId": "608847b4-ca84-4c77-eee1-19c2e6efcd50",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ }
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "How many apples do you want?1\n",
+ "How much is the price for each apple2\n",
+ "How many orange do you want?1\n",
+ "How much is the price for each orange2\n",
+ "How many mango do you want?1\n",
+ "How much is the price for each mango2\n",
+ "The total price is 6\n"
+ ]
+ }
+ ],
+ "source": [
+ "apple_amount= int(input(\"How many apples do you want?\"))\n",
+ "apple_price = int (input(\"How much is the price for each apple\"))\n",
+ "orange_amount= int(input(\"How many orange do you want?\"))\n",
+ "orange_price = int (input(\"How much is the price for each orange\"))\n",
+ "mango_amount= int(input(\"How many mango do you want?\"))\n",
+ "mango_price = int (input(\"How much is the price for each mango\"))\n",
+ "\n",
+ "total = (apple_amount*apple_price) + (orange_amount*orange_price) + (mango_amount*mango_price)\n",
+ "\n",
+ "print(\"The total price is {}\".format(total))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "source": [],
+ "metadata": {
+ "id": "QprMbsFKdzYr"
+ },
+ "execution_count": null,
+ "outputs": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "31fXlmEQqgvW"
+ },
+ "source": [
+ "# Ex 5 : Greeting"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "zvnmj8MGrJIw"
+ },
+ "source": [
+ "Write a program to greet the customer who provides the user name. Your program should ask the name of the customer and print \"Hello + customer name\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "Z6ynxZMarIXh",
+ "outputId": "94a4b5a0-f72b-426a-d964-ea8f3fea339d",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ }
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Please enter your nameaung ye kyaw\n",
+ "Hello aung ye kyaw\n"
+ ]
+ }
+ ],
+ "source": [
+ "name = input (\"Please enter your name\")\n",
+ "print (\"Hello \" + name )"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "wdCOX821a-3h"
+ },
+ "source": [
+ "# Ex 6: Random Number\n",
+ "Write a program that generates a random number, x, between 1 and 50, a random number y between 2 and 5, and computes x^y."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "PoJsT-Z2a-3h",
+ "outputId": "2a3c8e7b-2940-4259-8fa3-110352746224",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ }
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "The result is 3200000\n"
+ ]
+ }
+ ],
+ "source": [
+ "from random import randint\n",
+ "x = randint(1,50)\n",
+ "y = randint(2,5)\n",
+ "result = x**y\n",
+ "print('The result is ', result)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "xZVaWyGFa-3h"
+ },
+ "source": [
+ "# Ex 7: Greet many times.\n",
+ "Write a program that generates a random number between 1 and 10 and prints your name that many times."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "NVsKV-SMa-3h",
+ "outputId": "57000609-eccd-4ced-d3c7-cc05ca8c3b22",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ }
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Hi AYK\n",
+ "Hi AYK\n",
+ "Hi AYK\n",
+ "Hi AYK\n",
+ "Hi AYK\n",
+ "Hi AYK\n"
+ ]
+ }
+ ],
+ "source": [
+ "from random import randint\n",
+ "\n",
+ "times = randint(1,10)\n",
+ "\n",
+ "for i in range (times):\n",
+ " print(\"Hi AYK\")\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "t2yhXGgja-3h"
+ },
+ "source": [
+ "# Ex 8: Computing.\n",
+ "Write a program that asks the user to enter two numbers, x and y, and computes |x-y|/(x+y)."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "u9iS5asva-3i",
+ "outputId": "fb084a74-d896-4d9a-c092-2e5081deaf77",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ }
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Enter number 1 :5\n",
+ "Enter number 2: 3\n",
+ "The reuslt is 0.6\n"
+ ]
+ }
+ ],
+ "source": [
+ "num1 = int (input(\"Enter number 1 :\"))\n",
+ "num2 = int (input (\"Enter number 2: \"))\n",
+ "\n",
+ "result = abs(x-y)/(x+y)\n",
+ "\n",
+ "print (\"The reuslt is \", result)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "Rj1MBwvva-3i"
+ },
+ "source": [
+ "# Ex 9: Computing\n",
+ "\n",
+ "Write a program that asks the user for a number of seconds and prints out how many minutes and seconds that is. For instance, 200 seconds is 3 minutes and 20 seconds."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "PAANF0KHa-3i",
+ "outputId": "046a0853-d41a-419d-a8f8-3589364ad9fd",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ }
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Please enter the number in seconds200\n",
+ "The 200 seconds is 3 minutes : 20 seconds\n"
+ ]
+ }
+ ],
+ "source": [
+ "value = int (input (\"Please enter the number in seconds\"))\n",
+ "\n",
+ "minutes = int(value/60)\n",
+ "seconds = value%60\n",
+ "\n",
+ "print(\"The {} seconds is {} minutes : {} seconds\".format(value,minutes,seconds))\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "8srVR72-a-3i"
+ },
+ "source": [
+ "# Ex 10: Using Math Module\n",
+ "\n",
+ "Write a program that asks the user for a number and then prints out the sine, cosine, and tangent of that number."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "I3K07AJfa-3i",
+ "outputId": "515b4f23-9912-481a-fb9b-c8beac1765af",
+ "colab": {
+ "base_uri": "https://localhost:8080/"
+ }
+ },
+ "outputs": [
+ {
+ "output_type": "stream",
+ "name": "stdout",
+ "text": [
+ "Enter a number:45\n",
+ "The values are sine 0.8509035245341184, cosine 0.5253219888177297 and tangent 1.6197751905438615.\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "num = float(input(\"Enter a number:\"))\n",
+ "sine_value = math.sin(num)\n",
+ "cosine_value = math.cos(num)\n",
+ "tangent_value = math.tan(num)\n",
+ "\n",
+ "print(\"The values are sine {}, cosine {} and tangent {}.\".format(sine_value,cosine_value,tangent_value))\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "colab": {
+ "provenance": []
+ },
+ "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.12.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
\ No newline at end of file
diff --git a/Ex2_datatypes.ipynb b/Ex2_datatypes.ipynb
index f922c26..90530a3 100644
--- a/Ex2_datatypes.ipynb
+++ b/Ex2_datatypes.ipynb
@@ -1,191 +1,246 @@
{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {
- "colab_type": "text",
- "id": "view-in-github"
- },
- "source": [
- "
"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {
- "id": "X_Unw3z9u2-7"
- },
- "source": [
- "Ex 1 : Check the lenght of the string \"My name is python\""
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Ex 2: Check the number of times \"python\" (regardless of cases: PYTHON, python, Python\" appears in the paragraph : \"Floating-point values in Python are always done in double precision; hence, Python float types correspond to doubles in a C-like language.\""
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {},
- "outputs": [],
- "source": [
- "s = \"Floating-point values in Python are always done in double precision; hence, Python float types correspond to doubles in a C-like language.\""
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Ex 3: Combine two lists : ls1 = [\"apple\", \"banana\", \"cherry\"] and ls2 = [\"apple\", \"banana\", \"cherry\", \"apple\", \"cherry\"]. Print the number of elements in new list. "
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Ex 4: Create a dictionary for the following table: "
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "| Name | Age | \n",
- "| --- | --- | \n",
- "| Myo | 32 |\n",
- "| Thida | 64 |"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Ex 5: Combine two sets and print the combined set and its length. \n",
- "set1 = {\"Name\", \"age\", \"Height\"}\n",
- "set2 = {\"Name\", \"status\", \"Education\"}"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Ex 6: Write a program that asks the user to enter a string. The program should create a new string called new_string from the user's string such that the second character is changed to an asterisk and three exclamation points are attached to the end of the string. Finally, print new_string. "
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Ex 7: Write a program that converts the given string 's' to lowercase, removes all Punctuation marks such as period, hyphen, and commas from 's', and prints the resulting string."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "s = \"Floating-point values in Python are always done in double precision; hence, Python float types correspond to doubles in a C-like language.\"\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Ex 8: L1 and L2 should be identical. Write a program that finds the missing number in L2. "
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 7,
- "metadata": {},
- "outputs": [],
- "source": [
- "from random import randint\n",
- "L1 = list(range(1,101))\n",
- "L2 = L1.copy()\n",
- "L2.remove(randint(1,101))\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Ex 9: Write a program to copy the ls1 = [\"apple\", \"banana\", \"cherry\"] to a new list. Add the element \"blueberry\" to the new list, but keep the original list the same. "
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "colab": {
- "authorship_tag": "ABX9TyMRiET2AmIIzpj2LeD8ccas",
- "include_colab_link": true,
- "name": "Ex_2_datatypes.ipynb",
- "provenance": []
- },
- "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.12.1"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 1
-}
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "view-in-github",
+ "colab_type": "text"
+ },
+ "source": [
+ "
"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "X_Unw3z9u2-7"
+ },
+ "source": [
+ "Ex 1 : Check the lenght of the string \"My name is python\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "id": "gN6khYR8oZV8",
+ "outputId": "2216a185-1df6-49c2-9e0c-76ebed184d66",
+ "colab": {
+ "base_uri": "https://localhost:8080/",
+ "height": 164
+ }
+ },
+ "outputs": [
+ {
+ "output_type": "error",
+ "ename": "TypeError",
+ "evalue": "'str' object is not callable",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mname\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"My name is python\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+ "\u001b[0;31mTypeError\u001b[0m: 'str' object is not callable"
+ ]
+ }
+ ],
+ "source": [
+ "name = \"My name is python\"\n",
+ "print(len(name))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "BuJsT-exoZV9"
+ },
+ "source": [
+ "Ex 2: Check the number of times \"python\" (regardless of cases: PYTHON, python, Python\" appears in the paragraph : \"Floating-point values in Python are always done in double precision; hence, Python float types correspond to doubles in a C-like language.\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "cLqeovYnoZV9"
+ },
+ "outputs": [],
+ "source": [
+ "s = \"Floating-point values in Python are always done in double precision; hence, Python float types correspond to doubles in a C-like language.\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "pk3W0G-uoZV-"
+ },
+ "source": [
+ "Ex 3: Combine two lists : ls1 = [\"apple\", \"banana\", \"cherry\"] and ls2 = [\"apple\", \"banana\", \"cherry\", \"apple\", \"cherry\"]. Print the number of elements in new list."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "4xrZ9VyqoZV-"
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "qLpJSaFEoZV-"
+ },
+ "source": [
+ "Ex 4: Create a dictionary for the following table:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "owY3swBioZV-"
+ },
+ "source": [
+ "| Name | Age |\n",
+ "| --- | --- |\n",
+ "| Myo | 32 |\n",
+ "| Thida | 64 |"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "fthC1Pl6oZV_"
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "YUCDXsKHoZV_"
+ },
+ "source": [
+ "Ex 5: Combine two sets and print the combined set and its length.\n",
+ "set1 = {\"Name\", \"age\", \"Height\"}\n",
+ "set2 = {\"Name\", \"status\", \"Education\"}"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "DQchZRKgoZV_"
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "RDb9UAqcoZV_"
+ },
+ "source": [
+ "Ex 6: Write a program that asks the user to enter a string. The program should create a new string called new_string from the user's string such that the second character is changed to an asterisk and three exclamation points are attached to the end of the string. Finally, print new_string."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "4GnYsdJRoZWA"
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "lx1p8tY9oZWA"
+ },
+ "source": [
+ "Ex 7: Write a program that converts the given string 's' to lowercase, removes all Punctuation marks such as period, hyphen, and commas from 's', and prints the resulting string."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "TT5haXhnoZWA"
+ },
+ "outputs": [],
+ "source": [
+ "s = \"Floating-point values in Python are always done in double precision; hence, Python float types correspond to doubles in a C-like language.\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "MRgjy-f6oZWA"
+ },
+ "source": [
+ "Ex 8: L1 and L2 should be identical. Write a program that finds the missing number in L2."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "rKFeS9E8oZWA"
+ },
+ "outputs": [],
+ "source": [
+ "from random import randint\n",
+ "L1 = list(range(1,101))\n",
+ "L2 = L1.copy()\n",
+ "L2.remove(randint(1,101))\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "id": "e7qJ06DRoZWA"
+ },
+ "source": [
+ "Ex 9: Write a program to copy the ls1 = [\"apple\", \"banana\", \"cherry\"] to a new list. Add the element \"blueberry\" to the new list, but keep the original list the same."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "id": "QEe91Ed7oZWB"
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "colab": {
+ "name": "Ex_2_datatypes.ipynb",
+ "provenance": [],
+ "include_colab_link": true
+ },
+ "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.12.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
\ No newline at end of file
|