-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPython_practice2.py
More file actions
96 lines (74 loc) · 2.37 KB
/
Python_practice2.py
File metadata and controls
96 lines (74 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# What is the score?
# score = int(input("What is your test score? "))
# # Determine the grade.
# if score >= 90:
# print('Your grade is an A.')
# else:
# if score >= 80:
# print('Your grade is a B.')
# else:
# if score >= 70:
# print('Your grade is a C.')
# else:
# if score >= 60:
# print('Your grade is a D.')
# else:
# print('Your grade is an F.')
# What is the score?
# score = int(input("What is your test score? "))
# # Determine the grade.
# if score >= 90:
# print('Your grade is an A.')
# elif score >= 80:
# print('Your grade is a B.')
# elif score >= 70:
# print('Your grade is a C.')
# elif score >= 60:
# print('Your grade is a D.')
# else:
# print('Your grade is an F.')
#TESTING IF & IFELSE
#temperature = int(input("What is the temperature outside? "))
# if temperature > 80:
# print("Turn on the AC.")
# else:
# print("Open the windows.")
## Instructions
#### Grocery Store List
## Instructions
# Create a Python list to store the following items as a list of strings. You need to buy:
# * Milk
# * Bread
# * Eggs
# * Peanut Butter
#* Jelly
# Print out the list
# Wait! Your cousin is visiting next week, and they’re only allergic to peanuts! Change “peanut butter” in the list to “almond butter”.
# You just remembered that you have homemade jam that your neighbor made for you. Remove “jelly” from the list.
# You just used up the last of your coffee. Add “coffee” to your grocery list.
# Print out the updated list.
#from asyncio.constants import ACCEPT_RETRY_DELAY
#my_list = ["Milk", "Bread", "Eggs", "Peanut Butter", "Jelly"]
#print(my_list)
#my_list.remove("Peanut Butter")
#my_list.append("Almond Butter")
#my_list.remove("Jelly")
#my_list.append("Coffee")
#print(my_list)
# Info in Dictionaries
## Instructions
# Create a dictionary to store the following:
# # * Your pet's name
# * Your pet's age
# * A list of a few of your pet's hobbies
# * A dictionary of a few times you wake up during the week
# Print out the following:
# * Your pet's name and age.
# * How many hobbies your pet has.
# * What your pet's favorite hobby is.
# * What time your pet wakes on one of the days of the week.
# My_Pet = {}
# My_Pet["Name"] = "Ace"
# My_Pet["Age"] = 3
# My_Pet["Hobbies"] = ["Sleeping" , "Eating"]
# print(My_Pet)