r/learnpython • u/shadow_banshee • Nov 14 '21
URGENT: need to learn python ASAP
Hi all. I used to know some python a couple years ago and don’t remember too much of it. I stupidly volunteered to help a cute girl with coding for her class and now she’s needing help with it. Can someone teach me how to do good python stuff in the next 2 days. I understand for loops and while loops and printing strings and Booleans. Are there any other major things I need to know??? Thank you in advance. I just don’t wanna look stupid in front of her cuz I really like her and want to be helpful.
6
u/Professional-Lab5877 Nov 14 '21
“Automate the boring stuff” and this playlist
https://youtube.com/playlist?list=PLlcnQQJK8SUjW_HiBWhZ_XOfCq9Hu0aeY
5
3
u/Ill_Be_Alright Nov 14 '21
Graphing can be pretty nice. If you know how to use the append command “listName.append(variable)”, u can use the following code to fairly easily create a graph of something:
•import matplotlib.pyplot as plt •fig, ax = plt.subplots() •ax.plot(xVariable, yVariable)
There are plenty other bells and whistles, such as changing the range of that graph, or adding a legend to it:
•ax.plot(xVariable, yVariable, label=“equation”) •fig.legend(loc = “lower left”)
That code will graph it, and then put a legend in the lower left that has the “equation” labeled. Other bells and whistles below:
•ax.scatter(xVar, yVar) #creates a scatter plot instead
•ax.plot(x, y, linestyle=“dashed”, color=“magenta”) #plots it as a dashed magenta line. A list of colors and line styles can simply be googled
7
u/treeman1322 Nov 14 '21
Automate the boring stuff is the fastest way to pick stuff up
-3
u/PM_Me_Python3_Tips Nov 14 '21 edited Nov 14 '21
How are people upvoting this when it's clearly not true?
Is it just because it says "Automate the Boring Stuff"?
Judging by the downvotes the r/learnpython circlejerk with Automate The Boring Stuff is complete.
3
u/Over-Fondant65 Nov 14 '21
How are people upvoting anything here? Op is clearly not equipped to be teaching anyone !
3
2
u/Justin_Chieng Nov 14 '21
There is tons of tutorials online, but my advice is It's OK to look stupid in front her, trust me, u just have to be yourself.
1
u/QuestionabIeAdvice Nov 14 '21
With the basic methods already included, lists and dictionaries are pretty powerful. Learning more about their many uses is a good start. Start with the basic methods. Like iteration, slicing, indexing, other built-in functions like len and zip are also useful. List and dictionary comprehensions are a good way to impress a beginner.
Learning about all of the build-in methods for the objects in the default library should be sufficient for most needs.
String manipulation is also useful. For simple string formatting the recently added f-strings make for a more pleasant code-reading experience. Learn how to cast a string to an integer or vice versa. Learn how to capitalize a string, or strip it of unwanted characters.
If you don’t want to look up the documentation running dir(object) will print a list of all the methods. Then use help(object.method) to print out relevant helpful comments if any can be found. Once you’re finished with all that reply with a copy of your work and I’ll give you more stuff to learn.
1
u/huntalineage Nov 14 '21
Coursera python for everybody course from UMich. If you are advanced try python 3 programming specialization
1
1
1
1
Nov 14 '21
[removed] — view removed comment
1
u/shadow_banshee Nov 15 '21
You good? I’m not a troll I genuinely would like to know some basic python so I can help her. She’s really sweet and I really like her and like to have an excuse to be around her more even if it’s just for homework help. Sorry that you have so much hate in your life
1
Nov 15 '21 edited Nov 15 '21
[removed] — view removed comment
1
u/shadow_banshee Nov 15 '21
I’ve been brushing up on what I used to know but I only took a super basic class on the language. I just wanted good resources for the rest of the stuff I might encounter on her hw that wasn’t in my original class.
52
u/sabboo Nov 14 '21
Start by thinking with your other head.