Hello Everyone,
I have decided to mark my journey going through the information referenced over at Automate the Boring Stuff with Python through this blog so I can keep track of items that I have learned and things that I may re-learn through this. For everyone's reference, the documentation that I am following is through this website or directly from the vendor.
Chapter 0 - Basically helps you setup Python3 on your PC. In this case I am using a variant of Debian to install it on. It also explains how to properly troubleshoot an error, and how to look up problems online.
Chapter 1 - Explains how math works in Python using Idle. Basically the only thing that I did not know, mainly because I did not use it often is that % is Modulus/Remainder. It reads from Left to Right, and checks quotes and {}()'s accordingly. Difference between Strings, Integers and Floating Point Numbers (aaa, 1 or 2 or 3, and 1.242). You also need to have single quotes at the beginning and end of strings such as 'Hello World!' . You will also not be able to add Strings and Integers together, and text Concatenation takes the literal text and adds them together, so if there is no spaces in your 'text' then it wont add it in. If you use Multiplication with Integers and Strings, it'll create a literal concatenation of the amount multiplied. Storing variables is simple.
Important Code Notes:
variable = input() #This allows you to call out specific input from the user and is useful if needing to prompt for text.
#Commenting #As you have probably guessed by now, I have programmed in Python and other languages before as (#) is used as the universal code of Commenting out code. Another common one is // but that is for other programming languages.
print() #Prints text that is in the () on the screen
len() #Counts the length of the items in the ()
str(), int(), float() #Allows you to change the type of the item, assuming it makes sense.
Chapter 2 - Boolean and Comparison is covered in this chapter. This also covers "And", "Or" and finally "Not". It also explains block statements (cleaning your code up). It covers 'If', 'Elif' 'Else' statements. 'While' allows loops and how to use 'Break' to break out of a 'While' loop. 'For' is also covered so that you can do certain pieces of code up to a certain value using 'i'. It also shows how to use 'import' to import specific python code such as Random or sys. Finally using 'sys.exit()' you can explicitly escape out of your whole script of code early.
Chapter 3 and on will be covered within another Part.
I have decided to mark my journey going through the information referenced over at Automate the Boring Stuff with Python through this blog so I can keep track of items that I have learned and things that I may re-learn through this. For everyone's reference, the documentation that I am following is through this website or directly from the vendor.
Chapter 0 - Basically helps you setup Python3 on your PC. In this case I am using a variant of Debian to install it on. It also explains how to properly troubleshoot an error, and how to look up problems online.
Chapter 1 - Explains how math works in Python using Idle. Basically the only thing that I did not know, mainly because I did not use it often is that % is Modulus/Remainder. It reads from Left to Right, and checks quotes and {}()'s accordingly. Difference between Strings, Integers and Floating Point Numbers (aaa, 1 or 2 or 3, and 1.242). You also need to have single quotes at the beginning and end of strings such as 'Hello World!' . You will also not be able to add Strings and Integers together, and text Concatenation takes the literal text and adds them together, so if there is no spaces in your 'text' then it wont add it in. If you use Multiplication with Integers and Strings, it'll create a literal concatenation of the amount multiplied. Storing variables is simple.
Important Code Notes:
variable = input() #This allows you to call out specific input from the user and is useful if needing to prompt for text.
#Commenting #As you have probably guessed by now, I have programmed in Python and other languages before as (#) is used as the universal code of Commenting out code. Another common one is // but that is for other programming languages.
print() #Prints text that is in the () on the screen
len() #Counts the length of the items in the ()
str(), int(), float() #Allows you to change the type of the item, assuming it makes sense.
Chapter 2 - Boolean and Comparison is covered in this chapter. This also covers "And", "Or" and finally "Not". It also explains block statements (cleaning your code up). It covers 'If', 'Elif' 'Else' statements. 'While' allows loops and how to use 'Break' to break out of a 'While' loop. 'For' is also covered so that you can do certain pieces of code up to a certain value using 'i'. It also shows how to use 'import' to import specific python code such as Random or sys. Finally using 'sys.exit()' you can explicitly escape out of your whole script of code early.
Chapter 3 and on will be covered within another Part.
Comments
Post a Comment