-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLearning Diary
199 lines (156 loc) · 7.91 KB
/
Learning Diary
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#learning python dont tease me lol
*******INTRO********
#I have zero coding knowledge, only a few previous scripting activies that included:
#-PowerShell Commands
#-X-copy syntax settings
#-Editing registry hex with true or false statements.
***LONG TERM GOAL***
To Make a Card Game that I have invented into an Application, have it laucnh as an .exe or ios/android app.
**Sketchy idea of Learning Path**
Fluent in Methods
Learning Applications Classes
GUI output (so excited for this part)
I see these advanced __int__ and __str__ functions so I assume there is some funky sub-routine magic you can data storage and retreival?
Overall Coding best practise. things like defined functions and modules are kept indexed neatly in different areas of the code?
php and ux (Already fluid in photoshop/illustrator)
*************5/10/22********************
#This is my first ever Python task I have been assigned by a youtube instructor.
↓
#Goal: To print a simple output that has pre-determined string values.
_____________________________
Name
Age
Status(previous visitation)
_____________________________
# 1st Iteration
name = 'John Smith'
age = '20 year old'
status = 'New Patient'
print(name, age, status)
# After grasping the concepts of strings i naturally wanted more from this interactive form thus started my jounrey of self research and ending up with this.
# Final Iteration
while True:
first_name = input("What is your first name? ")
last_name = input("What is your last name? ")
age = input("What is your age? ")
while True:
status = input("Have you been here before?")
if status.lower() == "yes":
print("Thank you have a seat")
exit()
elif status.lower() == "no":
print("Please fill out New Patient Form")
break
else:
print("Yes or No answer only")
date_of_birth = input("What is your Date of Birth? (DD/MM/YYYY): ")
address = input("What is your current residential address?: ")
print("***Are these details correct?***")
print("Name: ", first_name, last_name)
print("Age: ", age)
print("Date of Birth: ", date_of_birth)
print("Address: ", address)
while True:
answer = input("Yes/No?: ")
if answer.lower() == "no":
break
elif answer.lower() == "yes":
print("Thank you. A doctor will be with you shortly.")
exit()
else:
print("Yes or No answers only.")
continue
#Learning through taking a simple task and expanding on its capibilities seems to be a working method of study for me at the moment.
#Things learned:
#-If/elfif/else Statements
#-While Loops
#-Int/Str conversions
#-string functions
#-Input/retreival of stored data
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
***********6/10/2022*************
#I have tasked myself today with including an int() conversion with some math into my previous code.
↓
#Goal: To determine the users age by their DOB input - current date ✔
#IF user age is <50 continue to next step ✔
#IF user age 50> ask for pension card number ✔
#Make an object and call its data.
#So I am currently stuck on how to create an object that can be referenced in a method.
↓
#define pencode as object and (pcode) as string attached.
def pencode(pcode):
#If age is over 50 print pension card number
if int(age) > 50:
print("|", "Pension Card No: ", int(pcardno))
return
print("***Are these details correct?***")
print("Name: ", first_name, last_name)
print("Age: ", age, "|", "Year Born: ", birthdate)
#I try to address the object in this print parenthesis but it returns the following error: <function pencode at 0x00000224E2556160>
print("Address: ", address, pencode)
Will try again tomorrow
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
************7/10/2022***********
A new day!
I will try to learn about how objects work at their fundimental level today so I can have more of a grasp on how to impliment them more efficently.
**UPDATE**
Make an object and call its data. ✔
# Functions
def pencode51(pcardno, age):
if int(age) > 50:
print("Name: ", first_name, last_name)
print("Age: ", age, "|", "Year Born: ", birthdate)
print("Address: ", address)
print("Pension Card No: ", int(pcardno))
return "Are these details correct?"
def pencode49(age):
if int(age) < 50:
print("Name: ", first_name, last_name)
print("Age: ", age, "|", "Year Born: ", birthdate)
print("Address: ", address)
return "Are these details correct?"
#I use these to call information for an if statement whether a user is over the age of 50yrs or not.
if age > 50:
print(pencode51(pcardno, age))
else:
print(pencode49(age))
Previous day issue is solved!
GOODNIGHT!
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
**********8/10/2022************
The pension card input does not support integers with spaces, i have learned a space is classed as a string character so design priciple does not work.
Today's Goal:
I need to learn to set static input fields, and space them out accoridng [1-9, 1-9, 1-9, "" 1-9, 1-9, 1-9, "" 1-9, 1-9, 1-9] = Example 345 643 342
↓
in this block of code
↓
# while True:
if int(age) > 50:
pcard = input("Do you have a pension card? [Y/N] ")
if pcard.lower() in ["yes", "y"]:
pcardno = int(input("Please enter your Pension Card Number"))
break
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
************9/10/2022************
Turn's out you dont need to define the pension card number as strictly int().
pcard = int(input("Do you have a pension card? [Y/N] "))
is now
pcard = input("Do you have a pension card? [Y/N] ")
NEW MODULE DISCOVERED!!!!!
↓
import re (RegEx)
A module to help search strings.
↓
Re-structured input to only accept the following paramaters:
- Numeric Characters Between 1 - 9
- Maxiumum of 9 Numeric Characters
- Most common re strings (^ = Start search, $ = End search)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
************10/10/2022************