Skip to content

Instantly share code, notes, and snippets.

View AtufaShireen's full-sized avatar
🙃

Atufa Shireen AtufaShireen

🙃
  • India
View GitHub Profile
@AtufaShireen
AtufaShireen / average.py
Created April 27, 2019 14:17
finding class average
lloyd = {
"name": "Lloyd",
"homework": [90.0, 97.0, 75.0, 92.0],
"quizzes": [88.0, 40.0, 94.0],
"tests": [75.0, 90.0]
}
alice = {
"name": "Alice",
"homework": [100.0, 92.0, 98.0, 100.0],
"quizzes": [82.0, 83.0, 91.0],
norm_string=input("enter a word: ")
secret_code=""
for char in norm_string:
secret_code+=str(ord(char)-35)
print(secret_code)
norm_string=""
for i in range(0,len(secret_code)-1,2):
char_code=secret_code[i] + secret_code[i+1]
norm_string+=chr(int(char_code)+35)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Tribute Page</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" type="text/css" href="main.css">
from datetime import date
curr_date=date.today()
while True:
try:
age=int(input('How Old Are You?'))
except ValueError:
print('please enter your age')
else:
break
req_age=100-age
def odd_even(num,*check):
if num%4==0:
return (num,'is a multiple of 4')
if num %2==0:
return (f'{num} is Even')
else:
print(f'{num} is Odd')
for k in check:
if k % num==0:
return (f'{k} is divisible {num}')
num=int(input('enter a num'))
x=[]
for i in range(2,num+1):
if num%i==0:
x.append(i)
print(x)
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]
print(set([i for i in a if i in b]))
x=input('Enter A Strings')
print('Palindrome' if x==x[::-1] else 'Not a palindrome')
from django.shortcuts import render
from django.http import HttpResponse
def home(request):
posts = [
{
'author': 'Atufa Shireen',
'title': 'Making A Web App',
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{%if title%}
<title>DjangoReads-{{title}}</title>
{%else%}
<title>DjangoReads</title>
{%endif%}
</head>