Skip to content

Instantly share code, notes, and snippets.

View rjshekar90's full-sized avatar

Raja Shekar rjshekar90

View GitHub Profile
# -*- coding: utf-8 -*-
# Calc age
name = raw_input("Name >>> ")
age = int(raw_input("Age >>> "))
year = 2016
while(age < 101):
@rjshekar90
rjshekar90 / # Odd or Even
Created May 4, 2016 06:46
# Odd or Even
# -*- coding: utf-8 -*-
# Odd or Even
no = int(raw_input("Enter the number >>> "))
if no % 2 == 0:
print "It is a even number"
@rjshekar90
rjshekar90 / List Less Than Ten
Last active May 7, 2016 07:25
List Less Than Ten
# -*- coding: utf-8 -*-
# List Less Than Ten
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
x = []
choice = int(raw_input("Enter a number between 0 and 90 >>"))
# -*- coding: utf-8 -*-
# Divisors
number = int(raw_input(">>> " ))
x = range (1, number+1)
@rjshekar90
rjshekar90 / List Overlap Solutions
Created May 8, 2016 08:34
List Overlap Solutions
# List Overlap Solutions
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
for element in a:
for x in b:
if element == x:
def bubbleSort(lst):
nums = list(lst)
for i in range(len(lst)):
for j in range(i+1, len(lst)):
if lst[j] < lst[i]:
lst[j], lst[i] = lst[i], lst[j]
return lst
#Hackerrank ------ Nested Lists
from collections import defaultdict
grades = defaultdict(list)
for _ in range(input()):
name = raw_input()
score = float(raw_input())
#Hackerrank ------ Finding the percentage
if __name__ == '__main__':
n = int(raw_input())
student_marks = {}
for _ in range(n):
line = raw_input().split()
name, scores = line[0], line[1:]
scores = map(float, scores)
#Hackerrank Python If-Else
#https://www.hackerrank.com/challenges/py-if-else
if __name__ == '__main__':
n = int(raw_input())
if n% 2 != 0:
print "Weird"
#https://www.hackerrank.com/challenges/python-loops
if __name__ == '__main__':
n = int(raw_input())
for i in range(n):
print i ** 2