#learn python with f.m.
Explore tagged Tumblr posts
crippl-hacker · 10 months ago
Text
Python Day 2
Today I am starting off with exercise 13. Exercise 13 introduces the concepts of variables, modules, and argv.
Tumblr media
[ID: Exercise 13 code. It imports the argv module from sys, then uses argv to create 4 variables, script, first, second, and third. Next print() is used to print out the different variables /ID]
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
When calling the program I was confused as to why I got the error of too many variables. Looking into this I found that the first variable of 'argv' is always going to be the script. I then fixed that and added in script as the first variable.
Next for the study drill I wrote a new variable and updated the code to print the retrieved information.
Tumblr media Tumblr media
Alrighty then - onto exercise 14. Exercise 14 is about practicing prompts and variables.
Tumblr media Tumblr media
In the study drills I updated the script with a new prompt and print statement.
Tumblr media Tumblr media
Exercise 15 is a simple program that prints out the contents of a file. An important thing to note is to always close the file when doing things like this!
Tumblr media
Exercise 16 practices making a copy of a file and then updating it with 3 lines from user input.
Tumblr media Tumblr media
I ended up running into the issue where it was saying that it couldn't read the file. I ended up finding out that .read() starts from the cursor position - and if the cursor is at the end of the file from writing it you will not have your file printed.
Tumblr media Tumblr media Tumblr media Tumblr media
Exercise 17 is practicing copying files over and was relatively simple.
Tumblr media Tumblr media
4 notes · View notes
tahrimsakib · 6 months ago
Text
Day 6-7
Date -06/06/2024
My Python Learning
Tumblr media Tumblr media Tumblr media
I learn how to make Dictionaries, if else, while loop in python. 
1. Add item, remove item, copy in Dictionaries
2. Dictionaries Methods
3. If Else
4. While loop
You can Learn with me.
3 notes · View notes
tahrimsakib · 6 months ago
Text
Day 2-3
26|05|2024
My Python Learning
I learn how to make list and matrix in python. (list part 2)
1.list comprehension
2.sort list
3.copy list
4.matrix
5.Tuples
(I am little sad cz my favourite players Toni Kroos is played his last game in Santiago Bernabeu. 🥺)
Tumblr media Tumblr media
4 notes · View notes
crippl-hacker · 10 months ago
Text
Python Day 5
Today we warm up by completing Exercise 25. This is even more practice with functions and variables!
Tumblr media
To run the program we call python in the terminal and import ex25 from there.
Tumblr media
As I was working through calling the different functions in the terminal I realized that I missed a function - specifically the one that sorted a sentence. I called it and ended up getting a mess of individual letters. After bug hunting I found the issue to be that I called sort_words(sentence) instead of sort_words(words)
Tumblr media
After fixing those issues I finished running through the function calls in the terminal and it went great!
Tumblr media
Up next is Exercise 26! We are halfway through the book and it is time for a test. We are given broken code that we copy paste into a file. Our job is to fix it and get the program running! As I went through the program I left comments wherever I was fixing code. Below is my finished and fixed program.
Tumblr media Tumblr media Tumblr media
And here is the output in the terminal:
Tumblr media
Exercise 27 went over different booleans as well as a chart to memorize. The next practical was exercise 28 where you type in different statements then guess if they will be true or false. With my previous experience in programming I already knew a lot - the only thing that tripped me up was NOT OR booleans. Here's the output of the terminal!
Tumblr media
Chugging right along to Exercise 29! ex29 introduced if statements. I already know lots about if statements from Javascript so this is more of a refresher than anything.
Tumblr media
And then the output:
Tumblr media
Exercise 30 introduces Else If statements.
Tumblr media
And the output:
Tumblr media
Exercise 31 combines everything that we've learned about If/Elif statements with the new concept of Nested statements. Using nested statements we are able to write a very simple Choose Your Own Adventure text game.
Tumblr media
Here are a couple different runs I did with this program. My first try was not the best - I ended up having my mind turned into Jello!
Tumblr media
My second run went better! I ran into a bear but I survived.
Tumblr media
For the study drill it challenged me to write my own text game. I made a very simple one and got about halfway through where I want it to be.
Tumblr media
That's it for today folks!
6 notes · View notes
crippl-hacker · 10 months ago
Text
Python Day 6
Today we are starting out with exercise 32. We are getting introduced to lists as well as for loops.
Tumblr media
And the output:
Tumblr media
Up next is ex33.py! This is introducing While loops.
Tumblr media
And then the output:
Tumblr media
1 note · View note
crippl-hacker · 10 months ago
Text
Python Day 4
We are starting out strong! Exercise 24 is a review of everything we've learned so far.
Tumblr media Tumblr media
And the output:
Tumblr media
Today was a pretty slow day and I only got one exercise done - but it’s better than nothing!
1 note · View note
crippl-hacker · 10 months ago
Text
Python Day 3
Today I am starting out with Exercise 18. It introduces the concepts of functions!
Tumblr media Tumblr media
Next is Exercise 19. It talks about how to use functions and variables together.
Tumblr media
And now for the output when I run it:
Tumblr media
In the study drill it challenged me to write my own function. I decided to write a function to check if you had enough crackers and cheese for a 1:1 ratio.
Tumblr media Tumblr media
And the output:
Tumblr media
Exercise 20 is about using functions along with files.
Tumblr media Tumblr media
0 notes
crippl-hacker · 10 months ago
Text
Python Day 1
I have prior experience in Python but it's been a couple years since I last used it and I've forgotten most of it. I'm working through the book 'Learn Python the Hard Way' v3 by Zed Shaw. If you are interested in getting a copy feel free to shoot me a message and I can help you out! This is the start of my post series on learning Python - if you have any suggestions, comments, or questions I would love to hear more! Also for this post I have used brief Image Descriptions and did not include the full program in the ID. If you want me to include the actual code in the ID please let me know and I will do that in the future under a line break so my posts don't eat up people's feeds.
Tumblr media
[ID 1: Exercise 10 program in VSCode. It uses variables and Print() to print out different sentences to demonstrate different escape sequences /ID]
Tumblr media
[ID 2: Output of Exercise 10. It is a list with cat food, fishies, catnip, and grass. /ID]
Exercise 10 is about learning different escape sequences. For example if you are defining your variable text string with "double quotes" and want to use double quotes within the text string you need to use an escape sequence so it doesn't think you are ending your variable early.
Another important thing with Escape Sequences is to make sure that you are using the \ backslash instead of / forward slash.
An important thing with the book is he gives you Study Drills on how to experiment and learn more on your own. I really like this book due to that, in addition to how copying the programs helps train your eye to pick up small errors. Let me tell you - the amount of time that I have spent confused as to why my program was broken and it turned out to be a missing character is a lot.
Tumblr media
[ID 3: Exercise 11 in VSCode using Print() and Input() to get someone's age, height, and weight /ID]
Tumblr media
[ID 4: Exercise 11 output saying I'm 23, 5'5, and 198 heavy /ID]
The Study Drill asks me to research Input() and to write another form to ask more questions. Researching Input I found that you not need to use Print statements - you can print the user input prompt directly inside the parenthesis of Input. I decided to write a form that would get your short, mid, and long term goals without using Print() statements to get user input.
Tumblr media
[ID 5: A python program that uses Input() to get short, mid, and long term goals before printing them all together /ID]
Tumblr media
[ID 6: The output of the above program. My long term career goal is to work in Cybersecurity, my mid term career goal is to go to college and get a degree in Computer Science, and my short term career goal is to get as many certificates as I can in my trade school /ID]
Exercise 12 introduces the concept that you can skip using Print statements and has you re-write Exercise 11 without using Print statements.
Tumblr media
Anyway that's all that I worked on today! Hopefully you learned something.
1 note · View note
crippl-hacker · 10 months ago
Text
About Me
Name: F.M. (Yes, like the radio)
Age: 20’s
Favorite Color: Orange
Favorite Coding Language: Python
Planned Major: Computer Science (Cybersecurity)
I’m also multiply disabled! I have HSD (probable EDS), IBD, a bunch of other stuff I’m not going to list and have hearing loss. I am a cane, rollator, and wheelchair user.
I’m passionate about Disability Activism, Social Justice, Accessibility, Urban Infrastructure Design, Environmentalism, Fanfiction, and Programming. I am currently in a trade program but hope to go to college after this.
I plan on using this blog to talk about Disability stuff and Programming. I’ll be starting out talking about my networking curriculum and Python.
Tags:
#cripplepunk is for disability talk
#disability is for general disability things like art or non cpunk related talk
#F.M. Learns Python is my Python series tag
#codeblr or #coding is for general programming content
#crippl-hacker asks is for any asks I receive
#fm talks is for personal posts
#image described I tag images consistently about 90% of the time. I try to add image descriptions but if not I use the #image undescribed tag. Any image descriptions in alt text will be tagged with #image description in alt
#rb is for reblogs
17 notes · View notes