From ce1fa8fb7650d851b7746e528eb0656f379d45f5 Mon Sep 17 00:00:00 2001 From: python589 Date: Sat, 28 Jun 2025 14:15:35 +0300 Subject: [PATCH] Add files via upload --- Copy of Welcome To Colab | 1 + 1 file changed, 1 insertion(+) create mode 100644 Copy of Welcome To Colab diff --git a/Copy of Welcome To Colab b/Copy of Welcome To Colab new file mode 100644 index 0000000..f771ff0 --- /dev/null +++ b/Copy of Welcome To Colab @@ -0,0 +1 @@ +{"cells":[{"cell_type":"markdown","metadata":{"id":"Wf5KrEb6vrkR"},"source":["# Welcome to Colab!\n","\n","## Explore the Gemini API\n","The Gemini API gives you access to Gemini models created by Google DeepMind. Gemini models are built from the ground up to be multimodal, so you can reason seamlessly across text, images, code, and audio.\n","\n","**How to get started?**\n","* Go to [Google AI Studio](https://aistudio.google.com/) and log in with your Google account.\n","* [Create an API key](https://aistudio.google.com/app/apikey).\n","* Use a quickstart for [Python](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Get_started.ipynb), or call the REST API using [curl](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/rest/Prompting_REST.ipynb).\n","\n","**Discover Gemini's advanced capabilities**\n","* Play with Gemini [multimodal outputs](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Image-out.ipynb), mixing text and images in an iterative way.\n","* Discover the [multimodal Live API](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Get_started_LiveAPI.ipynb ) (demo [here](https://aistudio.google.com/live)).\n","* Learn how to [analyze images and detect items in your pictures](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Spatial_understanding.ipynb\") using Gemini (bonus, there's a [3D version](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Spatial_understanding_3d.ipynb) as well!).\n","* Unlock the power of [Gemini thinking model](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/quickstarts/Get_started_thinking.ipynb), capable of solving complex task with its inner thoughts.\n"," \n","**Explore complex use cases**\n","* Use [Gemini grounding capabilities](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Search_grounding_for_research_report.ipynb) to create a report on a company based on what the model can find on internet.\n","* Extract [invoices and form data from PDF](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Pdf_structured_outputs_on_invoices_and_forms.ipynb) in a structured way.\n","* Create [illustrations based on a whole book](https://colab.research.google.com/github/google-gemini/cookbook/blob/main/examples/Book_illustration.ipynb) using Gemini large context window and Imagen.\n","\n","To learn more, check out the [Gemini cookbook](https://github.com/google-gemini/cookbook) or visit the [Gemini API documentation](https://ai.google.dev/docs/).\n"]},{"cell_type":"code","source":["first=input('enter first number:')\n","sec=input('send number:')\n","sum=int(first)+int(sec)\n","print(sum)"],"metadata":{"id":"Yfx7PiUb8az8","colab":{"base_uri":"https://localhost:8080/","height":388},"executionInfo":{"status":"error","timestamp":1751054154831,"user_tz":-180,"elapsed":3722,"user":{"displayName":"Affan Adeel","userId":"07764486690800381047"}},"outputId":"3a2268bc-3bd7-44df-94a4-44246010452d"},"execution_count":null,"outputs":[{"output_type":"error","ename":"KeyboardInterrupt","evalue":"Interrupted by user","traceback":["\u001b[0;31m---------------------------------------------------------------------------\u001b[0m","\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)","\u001b[0;32m/tmp/ipython-input-17-3363621751.py\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mfirst\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'enter first number:'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0msec\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'send number:'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0msum\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfirst\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msec\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msum\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;32m/usr/local/lib/python3.11/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36mraw_input\u001b[0;34m(self, prompt)\u001b[0m\n\u001b[1;32m 1175\u001b[0m \u001b[0;34m\"raw_input was called, but this frontend does not support input requests.\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1176\u001b[0m )\n\u001b[0;32m-> 1177\u001b[0;31m return self._input_request(\n\u001b[0m\u001b[1;32m 1178\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mprompt\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[1;32m 1179\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_parent_ident\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"shell\"\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[0;32m/usr/local/lib/python3.11/dist-packages/ipykernel/kernelbase.py\u001b[0m in \u001b[0;36m_input_request\u001b[0;34m(self, prompt, ident, parent, password)\u001b[0m\n\u001b[1;32m 1217\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1218\u001b[0m \u001b[0;31m# re-raise KeyboardInterrupt, to truncate traceback\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1219\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Interrupted by user\"\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1220\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mException\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1221\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlog\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwarning\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Invalid Message:\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexc_info\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n","\u001b[0;31mKeyboardInterrupt\u001b[0m: Interrupted by user"]}]},{"cell_type":"markdown","metadata":{"id":"Nma_JWh-W-IF"},"source":["Colab now has AI features powered by [Gemini](https://gemini.google.com). The video below provides information on how to use these features, whether you're new to Python, or a seasoned veteran.\n","\n","
\n"," \n"," Thumbnail for a video showing 3 AI-powered Google Colab features\n"," \n","
"]},{"cell_type":"markdown","metadata":{"id":"5fCEDCU_qrC0"},"source":["
\n","

What is Colab?

\n","
\n","\n","Colab, or \"Colaboratory\", allows you to write and execute Python in your browser, with\n","- Zero configuration required\n","- Access to GPUs free of charge\n","- Easy sharing\n","\n","Whether you're a **student**, a **data scientist** or an **AI researcher**, Colab can make your work easier. Watch [Introduction to Colab](https://www.youtube.com/watch?v=inN8seMm7UI) or [Colab Features You May Have Missed](https://www.youtube.com/watch?v=rNgswRZ2C1Y) to learn more, or just get started below!"]},{"cell_type":"markdown","metadata":{"id":"GJBs_flRovLc"},"source":["
\n","\n","## **Getting started**\n","
\n","\n","The document you are reading is not a static web page, but an interactive environment called a **Colab notebook** that lets you write and execute code.\n","\n","For example, here is a **code cell** with a short Python script that computes a value, stores it in a variable, and prints the result:"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"gJr_9dXGpJ05"},"outputs":[],"source":["seconds_in_a_day = 24 * 60 * 60\n","seconds_in_a_day"]},{"cell_type":"markdown","metadata":{"id":"2fhs6GZ4qFMx"},"source":["To execute the code in the above cell, select it with a click and then either press the play button to the left of the code, or use the keyboard shortcut \"Command/Ctrl+Enter\". To edit the code, just click the cell and start editing.\n","\n","Variables that you define in one cell can later be used in other cells:"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"-gE-Ez1qtyIA"},"outputs":[],"source":["seconds_in_a_week = 7 * seconds_in_a_day\n","seconds_in_a_week"]},{"cell_type":"markdown","metadata":{"id":"lSrWNr3MuFUS"},"source":["Colab notebooks allow you to combine **executable code** and **rich text** in a single document, along with **images**, **HTML**, **LaTeX** and more. When you create your own Colab notebooks, they are stored in your Google Drive account. You can easily share your Colab notebooks with co-workers or friends, allowing them to comment on your notebooks or even edit them. To learn more, see [Overview of Colab](/notebooks/basic_features_overview.ipynb). To create a new Colab notebook you can use the File menu above, or use the following link: [create a new Colab notebook](http://colab.research.google.com#create=true).\n","\n","Colab notebooks are Jupyter notebooks that are hosted by Colab. To learn more about the Jupyter project, see [jupyter.org](https://www.jupyter.org)."]},{"cell_type":"markdown","metadata":{"id":"UdRyKR44dcNI"},"source":["
\n","\n","## Data science\n","
\n","\n","With Colab you can harness the full power of popular Python libraries to analyze and visualize data. The code cell below uses **numpy** to generate some random data, and uses **matplotlib** to visualize it. To edit the code, just click the cell and start editing."]},{"cell_type":"markdown","metadata":{"id":"4_kCnsPUqS6o"},"source":["You can import your own data into Colab notebooks from your Google Drive account, including from spreadsheets, as well as from Github and many other sources. To learn more about importing data, and how Colab can be used for data science, see the links below under [Working with Data](#working-with-data)."]},{"cell_type":"code","execution_count":null,"metadata":{"id":"C4HZx7Gndbrh"},"outputs":[],"source":["import numpy as np\n","import IPython.display as display\n","from matplotlib import pyplot as plt\n","import io\n","import base64\n","\n","ys = 200 + np.random.randn(100)\n","x = [x for x in range(len(ys))]\n","\n","fig = plt.figure(figsize=(4, 3), facecolor='w')\n","plt.plot(x, ys, '-')\n","plt.fill_between(x, ys, 195, where=(ys > 195), facecolor='g', alpha=0.6)\n","plt.title(\"Sample Visualization\", fontsize=10)\n","\n","data = io.BytesIO()\n","plt.savefig(data)\n","image = F\"data:image/png;base64,{base64.b64encode(data.getvalue()).decode()}\"\n","alt = \"Sample Visualization\"\n","display.display(display.Markdown(F\"\"\"![{alt}]({image})\"\"\"))\n","plt.close(fig)"]},{"cell_type":"markdown","metadata":{"id":"VYV91hbKwP2J"},"source":["Colab notebooks execute code on Google's cloud servers, meaning you can leverage the power of Google hardware, including [GPUs and TPUs](#using-accelerated-hardware), regardless of the power of your machine. All you need is a browser.\n","\n","For example, if you find yourself waiting for **pandas** code to finish running and want to go faster, you can switch to a GPU Runtime and use libraries like [RAPIDS cuDF](https://rapids.ai/cudf-pandas) that provide zero-code-change acceleration."]},{"cell_type":"markdown","metadata":{"id":"vwnNlNIEwoZ8"},"source":["To learn more about accelerating pandas on Colab, see the [10 minute guide](https://colab.research.google.com/github/rapidsai-community/showcase/blob/main/getting_started_tutorials/cudf_pandas_colab_demo.ipynb) or\n"," [US stock market data analysis demo](https://colab.research.google.com/github/rapidsai-community/showcase/blob/main/getting_started_tutorials/cudf_pandas_stocks_demo.ipynb)."]},{"cell_type":"markdown","metadata":{"id":"OwuxHmxllTwN"},"source":["
\n","\n","## Machine learning\n","
\n","\n","With Colab you can import an image dataset, train an image classifier on it, and evaluate the model, all in just [a few lines of code](https://colab.research.google.com/github/tensorflow/docs/blob/master/site/en/tutorials/quickstart/beginner.ipynb)."]},{"cell_type":"markdown","metadata":{"id":"ufxBm1yRnruN"},"source":["Colab is used extensively in the machine learning community with applications including:\n","- Getting started with TensorFlow\n","- Developing and training neural networks\n","- Experimenting with TPUs\n","- Disseminating AI research\n","- Creating tutorials\n","\n","To see sample Colab notebooks that demonstrate machine learning applications, see the [machine learning examples](#machine-learning-examples) below."]},{"cell_type":"markdown","metadata":{"id":"-Rh3-Vt9Nev9"},"source":["
\n","\n","## More Resources\n","\n","### Working with Notebooks in Colab\n","\n","
\n","\n","- [Overview of Colab](/notebooks/basic_features_overview.ipynb)\n","- [Guide to Markdown](/notebooks/markdown_guide.ipynb)\n","- [Importing libraries and installing dependencies](/notebooks/snippets/importing_libraries.ipynb)\n","- [Saving and loading notebooks in GitHub](https://colab.research.google.com/github/googlecolab/colabtools/blob/main/notebooks/colab-github-demo.ipynb)\n","- [Interactive forms](/notebooks/forms.ipynb)\n","- [Interactive widgets](/notebooks/widgets.ipynb)\n","\n","
\n","\n","\n","### Working with Data\n","
\n","\n","- [Loading data: Drive, Sheets, and Google Cloud Storage](/notebooks/io.ipynb)\n","- [Charts: visualizing data](/notebooks/charts.ipynb)\n","- [Getting started with BigQuery](/notebooks/bigquery.ipynb)\n","\n","
\n","\n","### Machine Learning\n","\n","
\n","\n","These are a few of the notebooks related to Machine Learning, including Google's online Machine Learning course. See the [full course website](https://developers.google.com/machine-learning/crash-course/) for more.\n","- [Intro to Pandas DataFrame](https://colab.research.google.com/github/google/eng-edu/blob/main/ml/cc/exercises/pandas_dataframe_ultraquick_tutorial.ipynb)\n","- [Intro to RAPIDS cuDF to accelerate pandas](https://nvda.ws/rapids-cudf)\n","- [Getting Started with cuML's accelerator mode](https://colab.research.google.com/github/rapidsai-community/showcase/blob/main/getting_started_tutorials/cuml_sklearn_colab_demo.ipynb)\n","- [Linear regression with tf.keras using synthetic data](https://colab.research.google.com/github/google/eng-edu/blob/main/ml/cc/exercises/linear_regression_with_synthetic_data.ipynb)\n","\n","
\n","\n","\n","### Using Accelerated Hardware\n","
\n","\n","- [TensorFlow with GPUs](/notebooks/gpu.ipynb)\n","- [TPUs in Colab](/notebooks/tpu.ipynb)"]},{"cell_type":"markdown","metadata":{"id":"P-H6Lw1vyNNd"},"source":["
\n","\n","\n","\n","### Featured examples\n","\n","
\n","\n","- [Retraining an Image Classifier](https://tensorflow.org/hub/tutorials/tf2_image_retraining): Build a Keras model on top of a pre-trained image classifier to distinguish flowers.\n","- [Text Classification](https://tensorflow.org/hub/tutorials/tf2_text_classification): Classify IMDB movie reviews as either *positive* or *negative*.\n","- [Style Transfer](https://tensorflow.org/hub/tutorials/tf2_arbitrary_image_stylization): Use deep learning to transfer style between images.\n","- [Multilingual Universal Sentence Encoder Q&A](https://tensorflow.org/hub/tutorials/retrieval_with_tf_hub_universal_encoder_qa): Use a machine learning model to answer questions from the SQuAD dataset.\n","- [Video Interpolation](https://tensorflow.org/hub/tutorials/tweening_conv3d): Predict what happened in a video between the first and the last frame.\n"]},{"cell_type":"code","source":["print('Hi, what\\'s your name?')\n","\n","p=input()\n","\n","print('hello,'+ p )\n","#personal info\n","print('to talk give me some basic information')\n","\n","print(' type your name here:')\n"," g = input()\n","\n","print('Age:')\n","x = input()\n","\n","print('Gender:')\n","l = input()\n","\n"," print('profession')\n"," acd=input()\n","\n","print('date of birth')\n","op=input()\n","\n","print(\"number\")\n","iop=input()\n","\n","print('your gmail adress')\n","pot=input()\n","\n","print('your adress')\n","\n","print('Let me confirm one last time:')\n","\n","print('So this is your name: ' + g)\n","\n","print('This is your age: ' + x)\n","\n","print('And your gender: ' + l)\n","\n","h = input()\n","\n","print('Hello, ' + p)\n","\n","print('How is your day going?')\n","\n","d = input()\n","\n","\n","print('How can I help you?')\n","\n","e = input()\n","\n","print(e)\n","\n","print('ok')\n","\n","print('So what type of ' + e + '?')\n","\n","k= input()\n","\n","#typed response\n","\n","\n","#confirmation\n","\n","\n","print('ok now youre information is in my database')\n","\n","a=g\n","\n","b=k\n","\n","c=l\n","\n","print('well nice to meet you,'+p)\n","\n","u=input()\n","\n","print('my name is rotack')\n","\n","print('i am an ai assitant')\n","\n","w=input()\n","\n","print('i am usually used for new devs practice ')\n","\n","hi=input()\n","\n","print('so your problem that you want me to solve is,'+e)\n","\n","yt=input()\n","\n","print('sorry your problem is not in my data base')\n","\n","it=input()\n","\n","print('this all survey was to know more about you ')\n","\n","ut=input()\n","\n","print('thank you for your time')\n","\n","\n"],"metadata":{"id":"dE-M6b63vTgS"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["\n","print(\"Hi, what's your name?\")\n","p = input()\n","\n","print(\"Hello, \" + p)\n","\n","# Personal info\n","print(\"To talk, give me some basic information.\")\n","\n","print(\"Type your name here:\")\n","g = input()\n","\n","print(\"Age:\")\n","x = input()\n","\n","print(\"Gender:\")\n","l = input()\n","\n","print(\"Profession:\")\n","acd = input()\n","\n","print(\"Date of Birth:\")\n","op = input()\n","\n","print(\"Phone Number:\")\n","iop = input()\n","\n","print('your gmail adress')\n","gmail=input()\n","\n","print('your adress')\n"," prot=input()\n","\n","\n","print(\"Let me confirm one last time:\")\n","print(\"So this is your name: \" + g)\n","print(\"This is your age: \" + x)\n","print(\"Your gender: \" + l)\n","print(\"Your profession: \" + acd)\n","print(\"Your date of birth: \" + op)\n","print(\"Your number: \" + iop)\n","\n","h = input(\"Is that correct? (yes/no): \")\n","\n","print(\"Hello again, \" + p)\n","print(\"How is your day going?\")\n","d = input()\n","\n","print(\"How can I help you?\")\n","e = input()\n","\n","print(\"You said: \" + e)\n","print(\"Ok.\")\n","\n","print(\"So what type of \" + e + \"?\")\n","k = input()\n","\n","# Saving to variables (fake database)\n","a = g\n","b = k\n","c = l\n","\n","print(\"Ok, now your information is in my database.\")\n","\n","print(\"Well nice to meet you, \" + p)\n","u = input()\n","\n","print(\"My name is Rotack.\")\n","print(\"I am an AI assistant.\")\n","w = input()\n","\n","print(\"I am usually used for new devs' practice.\")\n","hi = input()\n","\n","print(\"So your problem that you want me to solve is: \" + e)\n","yt = input()\n","\n","print(\"Sorry, your problem is not in my database.\")\n","it = input()\n","\n","print(\"This whole survey was to know more about you.\")\n","ut = input()\n","\n","print(\"Thank you for your time!\")\n"],"metadata":{"id":"EZJRtOgr3ORu"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["import time\n","\n","def slow_print(text, delay=0.5):\n"," #a \"\"\"Simulate slow typing effect\"\"\"\n"," for char in text:\n"," print(char, end='', flush=True)\n"," time.sleep(delay)\n"," print()\n","\n","print(\"Hi, what's your name?\")\n","p = input()\n","\n","print(\"Hello, \" + p)\n","\n","# Personal info\n","slow_print(\"To acsess, give me some basic information.\")\n","\n","slow_print('type your name here')\n","g = input()\n","\n","slow_print(\"Age:\")\n","x = input()\n","\n","slow_print(\"Gender:\")\n","l = input()\n","\n","slow_print(\"Profession:\")\n","acd = input()\n","\n","slow_print(\"Date of Birth (DD/MM/YYYY):\")\n","op = input()\n","\n","slow_print(\"Phone Number:\")\n","iop = input()\n","\n","slow_print(\"Your Gmail address:\")\n","gmail = input()\n","\n","slow_print(\"Your address:\")\n","prot = input()\n","\n","print(\"Let me confirm one last time:\")\n","print(\"So this is your name: \" + g)\n","pot=input()\n","print(\"This is your age: \" + x)\n","odec=input()\n","print(\"Your gender: \" + l)\n","hope=input()\n","print(\"Your profession: \" + acd)\n","popy=input()\n","print(\"Your date of birth: \" + op)\n","callo=input()\n","print(\"Your phone number: \" + iop)\n","bot=input()\n","print(\"Your Gmail adress\")\n","kolp=input()\n","print(\"Your address: \" + prot)\n","baty=input()\n","\n","h = input(\"Is that all correct? (yes/no): \")\n","\n","if h.lower() != \"yes\":\n"," print(\"try again.\")\n"," # You could loop here to ask for corrections if desired\n","\n","print(\"Hello again, \" + p)\n","print(\"How is your day going?\")\n","d = input()\n","\n","print(\"How can I help you?\")\n","e = input()\n","\n","print(\"You said: \" + e)\n","print(\"Ok.\")\n","\n","print(\"So what type of \" + e + \"?\")\n","k = input()\n","\n","# Saving to variables (fake database)\n","a = g\n","b = k\n","c = l\n","\n","print(\"Ok, now your information is in my database.\")\n","\n","print(\"Well nice to meet you, \" + p)\n","u = input()\n","\n","print(\"My name is Rotack.\")\n","print(\"I am an AI assistant.\")\n","w = input()\n","\n","print(\"I am usually used for new devs' practice.\")\n","hi = input()\n","\n","print(\"So your problem that you want me to solve is: \" + e)\n","yt = input()\n","\n","print(\"Sorry, your problem is not in my database.\")\n","it = input()\n","\n","print(\"This whole survey was to know more about you.\")\n","ut = input()\n","\n","print(\"Thank you for your time!\")"],"metadata":{"id":"UjxUFzFj7VVL"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":[],"metadata":{"id":"xBEGHeKGBd1r"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["import time\n","def slow_print(text, delay=0.2):\n"," for char in text:\n"," print(char, end='', flush=True)\n"," time.sleep(delay)\n"," print()\n","slow_print('Hi there whats your name')\n","\n","p=input()\n","slow_print('oh thats a nice name')\n","print('want to know my name')\n","slow_print('my name is rotack')\n","o=input()\n","slow_print('ok i have to get some basic information')\n","slow_print('type your name')\n","\n","b=input()\n","slow_print('type your age')\n","hi=input()\n","\n","slow_print('type your adress')\n","\n","k=input()\n","slow_print('type your gmail adress')\n","m=input()\n","slow_print('type your birth day yy/mm/dd')\n","\n","h=input()\n","print('let me confirm one last time')\n","\n","slow_print('name,'+b)\n","slow_print('age,'+hi)\n","\n","slow_print('adress,'+k)\n","slow_print('gmail adress,'+m)\n","\n","slow_print('birth day,'+h)\n","print('am i right')\n","a=input()\n","if a.lower()!=\"yes\":\n"," print('try again')\n"," #Data base\n"," name=b\n"," age=hi\n"," adress=k\n"," gmail=m\n"," birth=h\n"," #data base end\n","if age<=18:\n"," print('you are an adult my friend')\n"," print('youre info is is now in my data base')\n"," q=input()\n"," print('i am developed by affan')\n","\n"," w=input()\n"," print(' i am an basic chat bot')\n"," print('well whats youre passion?,when typing only write the passion!')\n","\n"," d=input()\n","print('oh so your passion is,'+ d)\n","iop=input()\n","\n","print(' what,s youre faveriot food')\n","\n","\n"],"metadata":{"id":"lc8dLgWZPHd3","colab":{"base_uri":"https://localhost:8080/","height":114},"executionInfo":{"status":"error","timestamp":1751061375545,"user_tz":-180,"elapsed":68,"user":{"displayName":"Affan Adeel","userId":"07764486690800381047"}},"outputId":"5d6e38f7-b43e-4205-bcd0-86b941286f2b"},"execution_count":null,"outputs":[{"output_type":"error","ename":"SyntaxError","evalue":"invalid syntax (ipython-input-1-1679650920.py, line 23)","traceback":["\u001b[0;36m File \u001b[0;32m\"/tmp/ipython-input-1-1679650920.py\"\u001b[0;36m, line \u001b[0;32m23\u001b[0m\n\u001b[0;31m else:\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"]}]},{"cell_type":"code","source":[],"metadata":{"id":"75N4R2EMdg4z"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["print('hello there i am an ai assistant')\n","o=input()\n","print('i need to get some basic info to start chatting')\n","print('type your name')\n","b=input()\n","print('type your age')\n","hi=input()\n","print('type your adress')\n","k=input()\n","print('type your gmail adress')\n","m=input()\n","print('type your birth day yy/mm/dd')\n","h=input()\n","print('let me confirm one last time')\n","print('name,'+b)\n","print('age,'+hi)\n","print('adress,'+k)\n","print('gmail adress,'+m)\n","print('birth day,'+h)\n","print('am i right')\n","a=input()\n","print('ok youre info is now in my data base')\n","#dara base\n","name=b\n","age=hi\n","adress=k\n","gmail=m\n","birth=h\n","#data base\n","\n","print('i am developed by affan')\n","w=input()\n","print(' i am an basic chat bot')\n","print('ok lets start chatting')\n","print('type quit to stop')\n","#question\n","while True:\n"," question = input('you: ').lower()\n"," if question == 'quit':\n"," print(\"Bye, see you again!\")\n"," break\n"," elif question == 'what is your,e name':\n"," print('bot:my name is rotack')\n"," elif question =='how is youre day going':\n"," print('Bot:i am fine thanks for asking')\n"," elif question == 'who is the prime minister of pakistan':\n"," print('Bot:The Prime Minister of the Islamic Republic of Pakistan is Nawaz Sharif.')\n"," elif question == 'who was the first man on the moon':\n"," print('Bot:Neil Armstrong was the first man on the moon.')\n"," elif question == 'what is the capital of Pakistan':\n"," print('Bot:The capital of Pakistan is Islamabad.')\n"," elif question =='i am not feeling well':\n"," print('Bot:oh! so sorry to hear that. what is the problem')\n"," elif question == 'what is the capital of India':\n"," print('Bot:The capital of India is New Delhi.')\n"," elif question == 'who is the current super power of the world':\n"," print('Bot:America')\n"," elif question =='what is the largest religion followed in the world':\n"," print('Bot:Islam')\n"," elif question == 'what is the largest country in the world':\n"," print('Bot:Russia')\n"," print('Yes youre name is,'+b)\n"," elif question =='what is the largest planet in our solar system':\n"," print('Bot:Jupiter is the largest planet in our solar system.')"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"9CDRyi7larGl","executionInfo":{"status":"ok","timestamp":1751108260390,"user_tz":-180,"elapsed":15092,"user":{"displayName":"Affan Adeel","userId":"07764486690800381047"}},"outputId":"1f2cad1a-3a31-487d-fa35-4ad2b6c57e2b"},"execution_count":10,"outputs":[{"output_type":"stream","name":"stdout","text":["hello there i am an ai assistant\n","quit\n","i need to get some basic info to start chatting\n","type your name\n","sxd\n","type your age\n","\n","type your adress\n","sx\n","type your gmail adress\n","wdw\n","type your birth day yy/mm/dd\n","xewx\n","let me confirm one last time\n","name,sxd\n","age,\n","adress,sx\n","gmail adress,wdw\n","birth day,xewx\n","am i right\n","x\n","ok youre info is now in my data base\n","i am developed by affan\n","quit\n"," i am an basic chat bot\n","ok lets start chatting\n","type quit to stop\n","you: quit\n","Bye, see you again!\n"]}]},{"cell_type":"markdown","source":[],"metadata":{"id":"Op92Tr2c5fWq"}},{"cell_type":"markdown","source":[],"metadata":{"id":"CeTOk4vu5kYh"}},{"cell_type":"code","source":["!pip install gender-guesser\n"],"metadata":{"id":"CZDyb9y44Jql"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["import"],"metadata":{"id":"pMQPzFIOPBq9"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["print('hello world')"],"metadata":{"id":"rscJWi8ncDPi"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["\n","\n","\n","Class_Car:\n","pass\n","def__init__(self,make,model,year,color):\n","\n","\n"," self.make=make\n"," self.model=model\n"," self.year=year\n"," self.color=color\n","\n"," def drive(Self):\n"," print('this car is driving')\n","\n"," def stop(self)\n"," print('this car is stopped')\n","\n","\n","\n","\n","\n"],"metadata":{"id":"tS-xsQ2U2pXq"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["for _ in range(100):\n"," print('hello world')"],"metadata":{"id":"bexLDBsz7eqK"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["import car from car\n"],"metadata":{"id":"Q6E9besL4Ri4"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["for _ in range(10000000000):\n"," print('you are hacked')"],"metadata":{"id":"K3Ie-IMSzdZn"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["import time\n","import random\n","\n","def slow_print(text, delay=0.1):\n"," \"\"\"Simulate slow typing effect\"\"\"\n"," for char in text:\n"," print(char, end='', flush=True)\n"," time.sleep(delay)\n"," print()\n","\n","# Start of the simulated \"hack\"\n","slow_print(\"Initiating secure connection...\")\n","time.sleep(1)\n","\n","slow_print(\"Establishing system link...\")\n","time.sleep(2)\n","\n","slow_print(\"Connection successful! Welcome to the secure terminal.\")\n","\n","# Ask for credentials (simulated)\n","slow_print(\"Please enter your access credentials.\")\n","username = input(\"Username: \")\n","password = input(\"Password: \")\n","\n","# Simulate the \"hacking\" process\n","slow_print(\"Verifying credentials...\", 0.2)\n","\n","# Random success or failure simulation for fun\n","success = random.choice([True, False])\n","\n","if success:\n"," slow_print(f\"Access granted, {username}.\")\n","else:\n"," slow_print(f\"Access denied. Invalid credentials for {username}.\")\n"," slow_print(\"System is now locked down.\")\n"," exit()\n","\n","# Collect personal information (simulated, as in your original script)\n","slow_print(\"System override complete.\")\n","slow_print(\"Please enter the following information for verification:\")\n","\n","name = input(\"Name: \")\n","age = input(\"Age: \")\n","email = input(\"Email: \")\n","address = input(\"Address: \")\n","\n","slow_print(\"Processing information...\")\n","time.sleep(1)\n","\n","# Confirm the gathered data\n","slow_print(f\"Name: {name}\")\n","slow_print(f\"Age: {age}\")\n","slow_print(f\"Email: {email}\")\n","slow_print(f\"Address: {address}\")\n","confirm = input(\"Is this information correct? (yes/no): \")\n","\n","if confirm.lower() == \"yes\":\n"," slow_print(\"Data verified. Proceeding to the next phase.\")\n","else:\n"," slow_print(\"Error. Data mismatch detected. Terminating operation.\")\n"," exit()\n","\n","# Simulate a problem-solving scenario (your original problem-solving section)\n","slow_print(\"Enter the problem you need solved:\")\n","problem = input()\n","\n","slow_print(f\"Processing problem: {problem}...\")\n","time.sleep(2)\n","\n","# Simulate random result\n","result = random.choice([\n"," \"Solution found: Restart your system to resolve the issue.\",\n"," \"Solution found: Update your software to the latest version.\",\n"," \"Sorry, no solution available for the requested problem.\"\n","])\n","\n","slow_print(result)\n","\n","# End the session\n","slow_print(\"Operation complete. Logging out...\")\n","time.sleep(1)\n","slow_print(\"Goodbye.\")"],"metadata":{"id":"ZdTieOXB894K"},"execution_count":null,"outputs":[]}],"metadata":{"colab":{"provenance":[{"file_id":"/v2/external/notebooks/intro.ipynb","timestamp":1750536861838}]},"kernelspec":{"display_name":"Python 3","name":"python3"}},"nbformat":4,"nbformat_minor":0} \ No newline at end of file