You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: screens.py
+24-37
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,15 @@ def __init__(self, i, text, func):
7
7
self.screen_func=func
8
8
9
9
classScreens(Window):
10
+
defnew_lesson(self, screenNum):
11
+
screenNum-=1
12
+
self.new()
13
+
self.cenLbl(self.s[screenNum].text)
14
+
ifscreenNum>1:
15
+
prevBtn(self.s[screenNum-1].func)
16
+
ifnextScn<len(self.s)-1:
17
+
nextBtn(self.s[screenNum+1].func)
18
+
10
19
def__init__(self, master=None):
11
20
super(Screens, self).__init__(master)
12
21
self.master=master
@@ -31,68 +40,48 @@ def s_init(self):
31
40
self.cenBtn(s.text, s.screen_func)
32
41
33
42
defidle(self):
34
-
self.new()
35
-
self.cenLbl(self.s[0].text)
43
+
self.new_lesson(1)
36
44
self.multiLbl("Hello, and welcome to LearnPythonWithPython. Today we will be learning about how to set up the IDE called IDLE but ... come to think about it, you are viewing this application so you probably already have IDLE installed. See you later.")
37
-
self.btnNext(self.syn)
38
45
39
46
defsyn(self):
40
-
self.new()
41
-
self.cenLbl(self.s[1].text)
47
+
self.new_lesson(2)
42
48
self.multiLbl("Congratulations! You've completed lesson 1. This is lesson 2. To see the basic syntax, look at the source code for this application.")
43
-
self.btnPrev(self.idle)
44
-
self.btnNext(self.var)
45
49
46
50
defvar(self):
47
-
self.new()
48
-
self.cenLbl(self.s[2].text)
51
+
self.new_lesson(3)
49
52
self.multiLbl("Just like literally every single coding language in the world (except for maybe like BASIC and Assembly) and for sure every C based coding language (hint hint: Python is a C-based language), there are variables. There are many different types of variables in Python. Some examples are booleans (coming from Boolean algebra), lambdas (from lambda calculus) and numbers (from litterally every single form of math). Unlike 6th grade math, 7th grade math, 8th grade math, 9th grade math (Algebra I), 10th grade math (Geometry), 11th grade math (Algebra II), 12th grade math(Trigonometry?), college math(Calculus, Linear algebra, etc, etc, etc, and etc.), and some high school and college science(physics), variables in coding can have names longer than 1 letter with subscript. The only downside is that it takes up memory, and it takes up soooo mmuch storage. Like entire bytes. Soooooooo much!!!")
50
-
self.btnPrev(self.syn)
51
-
self.btnNext(self.data_types)
52
53
53
54
defdata_types(self):
54
-
self.new()
55
-
self.cenLbl(self.s[3].text)
55
+
self.new_lesson(4)
56
56
self.multiLbl("As I said last lesson, variables can be mmmmmmaaaaaannnnnnyyyyyy different types of things. A variable can be an str which is an str-ing of text surrounded by quotes (e.g. \"Hello, world!\"), an int which is an int-eger (e.g. 42), a float which is a float-ing point number (e.g. 3.14159265358979323846264338327950288419716939937510), a boolean which is a boolean value (which is either True or False. I think it's False. Wait nevermind it's true.), an array which stores an array of values surrounded in brackets where all the values are seperated by ,s (e.g. [\"Why?\", \"Are we stronger than the elements?\", \"What's yellow and dangerous?\", \"What do you get when you multiply six by seven?\", \"How many Vogons does it take to change a lightbulb?\", \"How many roads must a man walk down?\", 42, True, [\"Waaaait... an array inside an array?\", \"that's cray-cray\"], \"Is the array done yet?\", False,...] you get the idea.), a dictionary which is basically a dictionary for variables (e.g. ages = {\"Bob\": 100, \"Me\": 11}) and sooooo on and soooo forth")
57
-
self.btnPrev(self.var)
58
-
self.btnNext(self.hello_world)
59
57
60
58
defhello_world(self):
61
-
self.new()
62
-
self.cenLbl(self.s[4].text)
59
+
self.new_lesson(5)
63
60
self.multiLbl("Hello world programs are usually the first to be learned because they are so simple, but why do they make them so simple? Those programs could be made harder and more fun by just a little bit. First things first, you need to know what a hello world program looks like, so look in the console. Go on. I'm not going anywhere. You want to be able to do that? Well, that sucks for you. This lesson is not about hello world. It's about the base methods in Python. \"What's a method?\" I hear you typing in the comments. Well, I'm not telling you. And also I don't read the comments. So sucks for you.\nSo any ways, there are many base methods >:(don't even try asking):< such as print and input. Print prints text to the console. Input asks the user for input. That simple. Well not really. In print you have to put () after it because it's a *method* and inside those parentheses put what you want to say (HAS TO BE AN STR (can be a variable)), for example print(\"LearnPythonWithPython\") will print LearnPythonWithPython. Seriously. Try it. PRESS LE BUTTON!!!")
self.cenLbl("It's time for CHALLENGE TIME: Try to make a hello world program by declaring a variable called string and print()ing it")
66
-
self.btnPrev(self.data_types)
67
-
self.btnNext(self.inp)
68
63
69
64
definp(self):
70
-
self.new()
71
-
self.cenLbl(self.s[5].text)
65
+
self.new_lesson(6)
72
66
self.multiLbl("Hello, world! That last (mini) project was fun...ish. We want to make programs with UI! We want user input() ... i mean interface lol lmao rofl lellellellellelelelelelllelleleellelelelellelelel. so user \"interface\" as they call it is an interface where users interact. Hey! There's another possible name! User Interaction stuf! well anyways, let's get to the point. The input() method is a good starting point for UI. It allows the user to enter ... wait for it ... input()! Inside the parentheses thingies, you have to type in what ever you want the computer to ask you. For instance, press the button that has a line of code on it.")
73
67
self.cenBtn("inp = input(\"Enter your input here: \")\nprint(inp)", self.inp_code)
74
68
self.cenLbl("Now you try to figure out a practical purpose for the input() method. Enter it in the comments (that I tooooootally read)")
75
-
self.btnPrev(self.hello_world)
76
-
self.btnNext(self.if_statement)
77
69
78
70
defif_statement(self):
79
-
self.new()
80
-
self.cenLbl(self.s[6].text)
71
+
self.new_lesson(7)
81
72
self.multiLbl("If statements determine *if* a condition (e.g. 1>2 is False and \"hello\" == \"hello\" is True) is True, then it does the stuff indented after the colon(:). One example is")
82
-
btnTxt="""if True:
83
-
\tprint(\"Yay! It's True!\")
73
+
btnTxt="""
74
+
if True:
75
+
\tprint("if True: \n\t\"is always evaluated\"")
84
76
if False:
85
-
\tprint(\":( It's False")
77
+
\tprint("if False: \n\t\"is never evaluated\"")
86
78
"""
87
79
self.cenBtn(btnText, self.if_code)
88
-
self.btnPrev(self.inp)
89
-
self.btnNext(self.else_elif)
90
80
91
81
defelse_elif(self):
92
-
self.new()
82
+
self.new_lesson(8)
93
83
self.cenLbl(self.s[7].text)
94
-
self.multiLbl("\"But ... what if you want to test if something you just tested is not True? Do you need another if statement with (whatever condition) == False?\" I hear you commenting in the comment section. Well, the answer is NO STUPID!!! THIS IS PROGRAMMING!!! AND THIS LESSON EXISTS!!! WHAT DID YOU THINK IT WOULD BE ABOUT??? The solution lies in else statements, which literally translate to ... else. You just type else: and then whatever the **** you want if it is false. \"But what if you want to have an if and else statement *inside* an else statement?\" The answer is THIS IS CODING YOU NOT SMART PERSON. And plus, it says it in the title. elif is short for else if which is short for else-erwise if this is true.")
95
-
self.btnPrev(self.if_statement)
84
+
self.multiLbl("\"But ... what if you want to test if something you just tested is not True? Do you need another if statement with (whatever condition) == False?\" I hear you commenting in the comment section. Well, the answer is NO STUPID!!! THIS IS PROGRAMMING!!! AND THIS LESSON EXISTS!!! LOOK AT THE TITLE!!! WHAT DID YOU THINK IT WOULD BE ABOUT??? The solution lies in else statements, which literally translate to ... you guessed it — else. You just type else: and then whatever the print(\"****\") you want if the condition you tested is false. \"But what if you want to have an if and else statement *inside* an else statement?\" The answer is THIS IS CODING YOU NOT SMART PERSON. And plus, it says it in the title. elif is short for else if which is short for else-erwise if this is true.")
0 commit comments