From 857e3a24a05ffb5672f41b3cf0a49e9f2eea5a1a Mon Sep 17 00:00:00 2001 From: Trishita <35962310+trishitapingolia@users.noreply.github.com> Date: Fri, 12 Oct 2018 17:36:54 +0530 Subject: [PATCH 1/4] Add files via upload --- Divisors.ipynb | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Divisors.ipynb diff --git a/Divisors.ipynb b/Divisors.ipynb new file mode 100644 index 0000000..ae3ec3e --- /dev/null +++ b/Divisors.ipynb @@ -0,0 +1,39 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "a=int(input())\n", + "b=[]\n", + "for i in range(1,a):\n", + " if a%i==0:\n", + " b.append(i)\n", + "print(b)" + ] + } + ], + "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.6.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 1820b7a72d2da1b6e9476663486cc6fb9b6e9e3a Mon Sep 17 00:00:00 2001 From: Trishita <35962310+trishitapingolia@users.noreply.github.com> Date: Sat, 13 Oct 2018 00:21:08 +0530 Subject: [PATCH 2/4] Add files via upload --- primality.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 primality.py diff --git a/primality.py b/primality.py new file mode 100644 index 0000000..b738084 --- /dev/null +++ b/primality.py @@ -0,0 +1,17 @@ + +# coding: utf-8 + +# In[2]: + + +num =int(input()) +if num > 1: + for i in range(2,num): + if (num % i) == 0: + print(num,"is not a prime number") + break + else: + print(num,"is a prime number") +else: + print(num,"is not a prime number") + From 217e4fa34206983fc87cf1940a6cdceb8861c4ad Mon Sep 17 00:00:00 2001 From: Trishita <35962310+trishitapingolia@users.noreply.github.com> Date: Sat, 13 Oct 2018 00:25:50 +0530 Subject: [PATCH 3/4] Add files via upload From a65761836fc6bc3f6d33fbf2140871c9b035cbad Mon Sep 17 00:00:00 2001 From: Trishita <35962310+trishitapingolia@users.noreply.github.com> Date: Sat, 13 Oct 2018 01:47:54 +0530 Subject: [PATCH 4/4] Add files via upload --- list comprehension.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 list comprehension.py diff --git a/list comprehension.py b/list comprehension.py new file mode 100644 index 0000000..c797720 --- /dev/null +++ b/list comprehension.py @@ -0,0 +1,13 @@ + +# coding: utf-8 + +# In[1]: + + +a=[1,4,9,16,25,36,49,64,81,100] +b=[] +for i in a: + if i%2==0: + b.append(i) +print(b) +