From ec0a5ac16ef8abd025d279a89571dc8aca2ed3bb Mon Sep 17 00:00:00 2001 From: "[Ramu]" <[ramudur19@gmail.com]> Date: Wed, 11 Mar 2020 12:39:20 +0530 Subject: [PATCH] new ram --- ramu.txt | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 ramu.txt diff --git a/ramu.txt b/ramu.txt new file mode 100644 index 0000000..fc1f6d1 --- /dev/null +++ b/ramu.txt @@ -0,0 +1,96 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n", + "12\n", + "331\n", + "17\n", + "681\n" + ] + } + ], + "source": [ + "t=int(input())\n", + "for i in range(t):\n", + " s=int(input())\n", + " sum=1\n", + " for j in range(s):\n", + " sum=sum+(j*5)\n", + " print(sum)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n", + "hari irah happy yellow\n", + "Valid\n" + ] + } + ], + "source": [ + "n=int(input())\n", + "for i in range(n):\n", + " s=input().split()\n", + " if len(s)==1:\n", + " print(\"Valid\")\n", + " else:\n", + " status=True\n", + " for i in range(1,len(s)):\n", + " word1=s[i]\n", + " word2=s[i-1]\n", + " if word1[0]!=word2[-1]:\n", + " status=False\n", + " for i in s:\n", + " if s.count(i)>1:\n", + " status=False\n", + " if status:\n", + " print(\"Valid\")\n", + " else:\n", + " print(\"Invalid\")" + ] + }, + { + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}