Skip to content

Commit 6b2bb81

Browse files
committed
P1
P1
1 parent 1e10a2e commit 6b2bb81

5 files changed

Lines changed: 65 additions & 4 deletions

File tree

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.pythonPath": "C:\\Users\\Derrick Palmore\\AppData\\Local\\Programs\\Python\\Python37-32\\python.exe"
3+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Create Allergy check code
2+
# then PASTE THIS CODE into edX
3+
4+
# [ ] get input for input_test variable
5+
6+
input_test = input("Categories of food eaten in the last 24 hours: ")
7+
8+
9+
# [ ] print "True" message if "dairy" is in the input or False message if not
10+
11+
print("It is", "dairy".capitalize().lower().upper().swapcase() in input_test.capitalize().lower().upper().swapcase(),"that 'seafood, dairy, nuts, and chocolate cake' contains 'dairy'")
12+
# [ ] print True message if "nuts" is in the input or False if not
13+
14+
print("It is", "nuts".capitalize().lower().upper().swapcase() in input_test.capitalize().lower().upper().swapcase(),"that 'seafood, dairy, nuts, and chocolate cake' contains 'nuts'")
15+
16+
# [ ] Challenge: Check if "seafood" is in the input - print message
17+
18+
print("It is", "seafood".capitalize().lower().upper().swapcase() in input_test.capitalize().lower().upper().swapcase(),"that 'seafood, dairy, nuts, and chocolate cake' contains 'seafood'")
19+
20+
# [ ] Challenge: Check if "chocolate" is in the input - print message
21+
22+
print("It is", "chocolate".capitalize().lower().upper().swapcase() in input_test.capitalize().lower().upper().swapcase(),"that 'seafood, dairy, nuts, and chocolate cake' contains 'chocolate'")
23+

2 ksu scrape/ksu_scrape.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
'''
2-
TO use this code, you will first need to install the three packages being imported below using pip or a manual install method.
2+
To use this code, you will first need to install the three packages being imported below using pip or a manual install method.
33
'''
44
from bs4 import BeautifulSoup
55
import requests
66
import csv
77
from datetime import datetime
88

9-
9+
def ksuscraper(year):
1010
source = requests.get('http://news.kennesaw.edu/in-the-news/?&categories=in%20the%20news&year=2018').text
1111

1212
soup = BeautifulSoup(source, 'lxml')
@@ -53,6 +53,6 @@
5353
csv_writer.writerow([i,justtitle,source,URL,date])
5454

5555
i += 1
56-
print()
56+
print("Done")
5757

5858
ksu_news_csv.close()

3 calcGUI/CalcGUIModified.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def create_widgets(self):
168168
self.mod_bttn = Button(self, text="%", width=9, height=3,bg='LightBlue', fg='red', command=lambda: self.add_chr('%'))
169169
self.mod_bttn.grid(row=4, column=2)
170170

171-
self.seven_bttn = Button(self, text="Bushra", width=9, height=3, bg='LightBlue', fg='red',command=lambda: self.add_chr("Siddiqi"))
171+
self.seven_bttn = Button(self, text="Clr", width=9, height=3, bg='LightBlue', fg='red',command=lambda: self.add_chr("End"))
172172
self.seven_bttn.grid(row=1, column=0)
173173

174174
self.eight_bttn = Button(self, text="8", width=9, height=3,bg='LightBlue', fg='red', command=lambda: self.add_chr(8))

3 calcGUI/finalcodeP1.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# [ ] create, call and test the adding_report() function
2+
3+
def adding_report(report):
4+
total = 0
5+
while True:
6+
add_numbers = input("Input an integer to add to the total or 'Q' to quit: ")
7+
8+
items = ""
9+
if add_numbers.isdigit():
10+
thisnumber = int(add_numbers)
11+
print("thisnumber =",thisnumber,type(thisnumber))
12+
total = total + thisnumber
13+
print("new total = ",total)
14+
if report == "A":
15+
item = add_numbers
16+
else:
17+
print(add_numbers)
18+
elif add_numbers.startswith("Q"):
19+
if report == "A":
20+
print(total)
21+
print(item)
22+
break
23+
else:
24+
print(total)
25+
break
26+
else:
27+
print("Input is invalid")
28+
29+
30+
31+
32+
33+
34+
35+
adding_report("A")

0 commit comments

Comments
 (0)