Commit 001eea44 authored by Ian Stump's avatar Ian Stump

Merge branch 'week2day5' into 'master'

Week2/day5/6 and week3/day1/2

See merge request !3
parents 1627b6fc b8d8751c
.DS_Store
node_modules/
node_modules
/dist/
dist
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>| Motion</title>
<link rel="stylesheet" href="./css/main.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css"
integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="header">
<div class="motion">
<img src="assets/images/logo.png">
<p> Motion</p>
</div>
<div class="Posts">
<img src="./assets/images/posts_logo.png">
<p> Posts</p>
</div>
<div class="Find_friends">
<img src="./assets/images/posts_logo.png"> <!-- find image for here-->
<p> Posts</p>
</div>
</div>
<div class="search_bar">
<div class="search">
<img src="assets/images/logo.png"> <!-- find image for here-->
<p> Search posts...</p>
</div>
<div class="top_right_search_bar">
<p class="liked"> Liked</p>
<p> Friends</p>
<p>Follow</p>
</div>
</div>
<div class="col_left">
<!-- look at scss layout-->
<div class="placeholder_post">
<img src="assets/images/users/jennifer.png">
<p>whats's on your mind?</p>
<img src="./assets/images/send_button.png">
</div>
<div clas="post_left">
<div class="post_left_header">
<img src="assets/images/users/jennifer.png">
<p>Jennifer Smith</p>
<p class="just_now"> Just now</p>
</div>
<div class="post_left_caption">
<p>bla bla</p>
</div>
<div class="post_left_images_top">
<img src="./assets/images/feedPics/image1.png">
<img src="./assets/images/feedPics/image2.png">
</div>
<div class="post_left_images_bottom">
<img src="./assets/images/feedPics/image3.png">
<img src="./assets/images/feedPics/image4.png">
</div>
<div class="post_left_footer">
<div class="like">
<img> <!-- find image for here-->
<p>Like</p>
</div>
<div class="share">
<img> <!-- find image for here-->
<p>Share</p>
</div>
</div>
</div>
</div>
<div class="col_right">
<!-- look at scss layout-->
<div class="top_right_post">
<div class="top_right_post_header">
<img src="assets/images/users/patricia.png">
<p> Patricia Jindal</p>
<p class="time_ago"> 6h ago</p>
</div>
<div class="top_right_post_body">
<p>bla bla bla</p>
</div>
<div class="top_right_post_footer">
<div class="like">
<!-- this is the same class name as other post footers-- make sure it works accross all posts-->
<img> <!-- find image for here-->
<p>Like</p>
</div>
<div class="share">
<!-- this is the same class name as other post footers-- make sure it works accross all posts-->
<img> <!-- find image for here-->
<p>Share</p>
</div>
<div class="likes">
<img> <!-- find image for here-->
<p>Likes</p>
</div>
</div>
</div>
<div clas="bottom_right_post">
<div class="bottom_right_post_header">
<img src="assets/images/users/alber.png">
<p>Albert Lawrence</p>
<p class="shared_a_post"> Shared a post</p>
<p class="just_now"> June 20</p>
</div>
<div class="bottom_right_post_caption">
<p>bla bla bla</p>
</div> <!-- CONTINUE HERE-->
<div class="post_left_images_top">
<img src="./assets/images/feedPics/image1.png">
<img src="./assets/images/feedPics/image2.png">
</div>
<div class="post_left_images_bottom">
<img src="./assets/images/feedPics/image3.png">
<img src="./assets/images/feedPics/image4.png">
</div>
<div class="post_left_footer">
<div class="like">
<img> <!-- find image for here-->
<p>Like</p>
</div>
<div class="share">
<img> <!-- find image for here-->
<p>Share</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
{
"name": "motion",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"scss": "node-sass --watch ./sass/main.scss -o css"
},
"author": "Laurent Hoxhaj",
"license": "ISC",
"dependencies": {
"node-sass": "^4.11.0"
}
}
:root {
--color-primary: #c468ff;
--linear-gradient: linear-gradient(102deg, #c468ff, #6e91f6);
}
* {
margin: 0;
padding: 0;
}
*,
*::after,
*::before {
box-sizing: inherit;
}
html {
box-sizing: border-box;
font-size: 62.5%; // 1rem = 10px;
}
body {
font-family: 'Roboto', sans-serif;
font-weight: 400;
}
\ No newline at end of file
.container {
height: 100%;
}
\ No newline at end of file
@import "base";
@import "layout";
@import "components"
\ No newline at end of file
{
"lockfileVersion": 1
}
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.7 (venv)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (venv)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/WEEK3.iml" filepath="$PROJECT_DIR$/.idea/WEEK3.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
.idea
.DS_Store
\ No newline at end of file
.idea
.DS_Store
\ No newline at end of file
print("Let’s calculate your BMI (kg/m2)")
user_w_input= input("what is your weight(in Kg)? ")
user_h_input=input("what is your height(in cm)?")
def user_BMI(user_w_input,user_h_input ):
user_weight = float(user_w_input)
user_height = int(user_h_input)*0.001 #to go from cm to m
BMI=user_weight/user_height*user_height
output = " you are "
if BMI<18.5:
output = "underweight"
elif BMI>18.5 and BMI<24.9 :
output += "average"
elif BMI > 25 and BMI < 29.9:
output +="overweight"
elif BMI > 30 and BMI < 34.9:
output += "obese"
elif BMI > 35:
output += "extremely obese"
return output
print(user_BMI (user_w_input,user_h_input))
def dict(n):
a= {x: x*x for x in range(1,n) }
return a
print(dict(10))
# for n=10:
# {1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81, 10: 100}
\ No newline at end of file
import math
import random
user_input=int(input("I am thinking of a number from \'1-10\'. Can you find it? You have 5 tries." ))
def start(user_input):
number=random.randint(1,11)
print(number)
print(user_input)
count = 1
while user_input != number :
if user_input > number:
count += 1
user_input=int(input("it's lower than that. try again"))
elif user_input < number:
count += 1
user_input=int(input("it's higher than that. try again"))
else:
return count
print("congrats you guessed it in " + str(count) + " tries.")
user_input_end=input("Do you want to play again? Y/N" )
play_again(user_input_end)
def play_again(user_input_end):
if user_input_end=="Y":
user_input_new = int(input("I am thinking of a number from \'1-10\'. Can you find it? You have 5 tries."))
start(user_input_new)
elif user_input_end=="N":
print("goodbye!")
print(start(user_input))
shopping_list = []
def add_item():
global shopping_list #to allow for changes to the global variable
user_add=input("what do you want to add?" )
user_position = input("what list position do you want to add your item in? input \'a\' if any or a position number")
if user_position.lower() == "a": #to make it case-insensitive
shopping_list.append({len(shopping_list)+1 : user_add})
elif type(int(user_position))== int :
shopping_list.insert(int(user_position)-1, {int(user_position): user_add})
# WIP - to update the keys numbers after removal
#WIP - code not going into the else
else:
print("please try again")
add_item()
return shopping_list
def remove_item():
global shopping_list #to allow for changes to the global variable
user_remove=input("what do you want to remove? Please input the item number. " )
del shopping_list[int(user_remove)-1]
# WIP - to update the keys numbers after removal
"""
for item in shopping_list:
for key in item.keys():
if key > int(user_remove):
key -= 1
"""
return shopping_list
def show_items():
global shopping_list
print(*shopping_list)
def help_menu():
print("Press \'h\' for help menu")
print("Press \'s\' to show the item in your list")
print("Press \'a\' to add a new item to the list")
print("Press \'r\' to remove an item from the list")
print("Press \'q\' to quit")
while True:
user_to_do=input("What do you want to do?" )
if user_to_do == "a":
add_item()
elif user_to_do == "r":
remove_item()
elif user_to_do == "s":
show_items()
elif user_to_do == "h":
help_menu()
elif user_to_do == "q":
break
print("goodbye")
print(help_menu())
\ No newline at end of file
array=[1,2,3,4,5,6,7,8,9,10]
my_filter= list(filter( lambda x: x % 2 == 0, array))
print(my_filter)
#Write a function find_numbers(min, max) that will find all numbers that are a multiple of 7 but not a multiple of 5.
def find_numbers(min,max):
result=[]
for x in range(min,max):
if x%7==0 and x%5!=0:
result.append(x)
return result
print(find_numbers(2,100))
#second way to do it just with filter and lambda
def find_numbers2(min,max):
return list(filter(lambda x: (x%7==0 and x %5!=0), range(min,max)))
print(find_numbers2(2,100))
\ No newline at end of file
squares_list=[x*x for x in range(1,21)]
print_list= squares_list[len(squares_list)-5:len(squares_list):]
print(print_list)
# [256, 289, 324, 361, 400]
\ No newline at end of file
orders = [
{
'id': 'order_001',
'item': 'Introduction to Python',
'quantity': 1,
'price_per_item': 32,
},
{
'id': 'order_002',
'item': 'Advanced Python',
'quantity': 3,