Skip to content

Instantly share code, notes, and snippets.

View arjun921's full-sized avatar
🧠
Perpetual Learner

Arjun Sunil arjun921

🧠
Perpetual Learner
View GitHub Profile
@arjun921
arjun921 / designer.html
Last active August 29, 2015 14:12
designer
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<polymer-element name="my-element">
<template>
<style>
@arjun921
arjun921 / designer.html
Last active August 29, 2015 14:12
designer
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<polymer-element name="my-element">
@arjun921
arjun921 / designer.html
Last active August 29, 2015 14:12
designer
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
a = [1,2,3,6,2,5,7,9,2,3,7,9,10,25,89]
b = [1,2,6,8,3,1,7,0,00,335,247,21,681,146]
a = set (a)
b = set (b)
print(a)
print(b)
listPal = input("Enter word: ")
if listPal == listPal[::-1]:
print("String is palindrome")
else:
print("String is not palindrome")
import getpass,os
#clears screen before executing game
os.system('clr')
os.system('clear')
#game commmences
print("*"*90)
print ("Rock Paper Scissors Game")
print ("="*90)
import random
a = random.randint(1,9)
b = int(input("Enter your guess(Numbers between 1-9)"))
print("your guess was too high :/ Try again Next time" if b>a else "your guess was perfect" if b==a else "Your guess was too low :/ Try again Next Time")
@arjun921
arjun921 / 18_December_2016_List_Overlap_Comprehensions.py
Created December 18, 2016 04:43
Take two lists and write a program that returns a list that contains only the elements that are common between the lists (without duplicates).
import random
a = random.sample(range(100), 5)
b = random.sample(range(100), 9)
print (a)
print(b)
new = set([i for i in a if i in b])
print (new)
@arjun921
arjun921 / 25_December_2016_Decode_a_Web_Page.py
Created December 25, 2016 13:07
Use the BeautifulSoup and requests Python packages to print out a list of all the article titles on the New York Times homepage.
#Use the BeautifulSoup and requests Python packages to print out a list of all the article titles on the New York Times homepage.
import requests
from bs4 import BeautifulSoup
url = 'http://www.nytimes.com'
r = requests.get(url)
r_html = r.text
soup = BeautifulSoup(r_html, "lxml")
@arjun921
arjun921 / 26_December_2016_Cows_and_Bulls.py
Created December 26, 2016 17:07
Create a program that will play the “cows and bulls” game with the user. The game works like this: Randomly generate a 4-digit number. Ask the user to guess a 4-digit number. For every digit that the user guessed correctly in the correct place, they have a “cow”. For every digit the user guessed correctly in the wrong place is a “bull.” Every ti…
import random
def game(cow,bull,rnum,unum):
rnum = random.randint(1000,9999)
#print (rnum)
unum = int(input('Enter your guess:'))
for i,j in zip(str(rnum),str(unum)):
if i==j:
cow = cow+1
else: