-
Notifications
You must be signed in to change notification settings - Fork 0
/
B.json
1 lines (1 loc) · 2.24 KB
/
B.json
1
{"cells": [{"cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": ["deff(x):\n", "y=6*x**2+3*x+2\n", "print(y)\n", "\n"]}, {"cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": ["l0=[1,2,3,3,3,3,4,5]\n", "l1=[]\n", "deff(l1,l2):\n", "l2=list(set(l1))\n", "print(l2)\n"]}, {"cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": ["\n", "string='abcABC'\n", "deff(string):\n", "uc=0\n", "lc=0\n", "foriinstring:\n", "if97<=ord(i)<=122:\n", "lc=lc+1\n", "elif65<=ord(i)<=90:\n", "uc=uc+1\n", "else:\n", "pass\n", "print('No.ofUppercasecharacters:',uc,'\\nNo.ofLowercaseCharacters:',lc)\n", "\n"]}, {"cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [], "source": ["string1='LevelheadedLlama'\n", "string2='CrazyKangaroo'\n", "\n", "deff(str):\n", "a=str[0]\n", "str=str.split()\n", "foriinstring:\n", "ifi[0]==a:\n", "pass\n", "else:\n", "returnprint('False')\n", "returnprint('True')\n", "\n", "f(string1)\n"]}, {"cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [], "source": ["n=114514\n", "a=11451\n", "b=1145141919810\n", "ifninrange(a,b):\n", "print('yes')\n", "else:\n"]}, {"cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [], "source": ["string='Iamhome'\n", "string=string.split()[::-1]\n"]}, {"cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [], "source": ["frommathimportfactorial\n", "\n", "\n", "num=5\n", "defsol(num):\n", "print(factorial(num))\n", "\n"]}, {"cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [], "source": ["num=496\n", "ls=[]\n", "foriinrange(1,num):\n", "ifnum%i==0:\n", "ls.append(i)\n", "else:\n", "pass\n", "ifsum(ls)==num:\n", "print('yes')\n", "else:\n"]}], "metadata": {"kernelspec": {"display_name": "Python3.9.12('base')", "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.9.13"}, "orig_nbformat": 4, "vscode": {"interpreter": {"hash": "5179d32cf6ec497baf3f8a3ef987cc77c5d2dc691fdde20a56316522f61a7326"}}}, "nbformat": 4, "nbformat_minor": 2}