Current Events > ITT: Learning Python

Topic List
Page List: 1, 2, 3, 4, 5, 6, 7 ... 10
Starks
07/22/21 9:50:00 AM
#101:


I suck at coding but Python was the only language that looked half decent.

C++ and Java infuriated me with their memory management.
---
Posted with GameRaven 3.6.0_B3
... Copied to Clipboard!
SpiritSephiroth
07/22/21 9:25:52 PM
#102:


SomeLikeItHoth posted...
Spent another 30 minutes and finally figured it out! I forgot to put a @property (look this up) tag above one method and I made three other typos. So it was a combination of things. But now my code is working 100%. Just needed to do some trial and error.

That's great. Now my suggestion to you would be to search how other people did something similar and compare it to yours. Here's one I did a few months ago.


1337toothbrush posted...
Alright, so I threw together a quick and dirty structured text adventure. Each room is its own function and the game runs in a loop with a win or loss condition. This allows you to jump back and forth between rooms and adding a room is simply a matter of writing another function and having one of the existing rooms simply "link" to that room by setting the state.

Here is the link: https://ideone.com/xFIwVn (You can see the execution here with sample input under stdin)

and here's the pastebin if you prefer that: https://pastebin.com/SAmvm6Fr

Thanks! I'll give these a go. I tried to do If statements myself but totally forgot to create variables like an idiot. Such a basic mistake lol

---
... Copied to Clipboard!
SpiritSephiroth
07/23/21 10:11:40 PM
#103:


Bump, been busy but starting from Sunday I should be able to put more time into Coding!

---
... Copied to Clipboard!
SpiritSephiroth
07/24/21 10:24:31 PM
#104:


Okay, did a bit after coming home. Its now 3:30am, sleep time.

---
... Copied to Clipboard!
SomeLikeItHoth
07/25/21 11:54:02 PM
#105:


Did you make anything?

---
FAM FOREVER.
... Copied to Clipboard!
SpiritSephiroth
07/25/21 11:54:33 PM
#106:


SomeLikeItHoth posted...
Did you make anything?

Did a bit of if statements with a new story adventure today. Want to see how I can do it differently this time.

---
... Copied to Clipboard!
SpiritSephiroth
07/26/21 6:37:37 PM
#107:




What I've done so far. At the end, all the choices of the user is going to reflect and change how the story turns out which is why I'm using Boolean values.

Edit: Also I just realized I didn't need to update the Boolean value of the old man definition when leaving him instead of helping him.

---
... Copied to Clipboard!
1337toothbrush
07/26/21 6:41:31 PM
#108:


You exit the entire program if the user inputs something you don't feel like handling.

---
... Copied to Clipboard!
SpiritSephiroth
07/26/21 6:49:27 PM
#109:


1337toothbrush posted...
You exit the entire program if the user inputs something you don't feel like handling.

Yeah, I should really put more effort into that. I'll learn how to handle it. I did a tutorial on that a while ago, but totally forgot how to do it.

Edit: Actually now that I think about it, I may have written it down in my lesson notes. I'll check them out.

---
... Copied to Clipboard!
1337toothbrush
07/26/21 6:57:57 PM
#110:


... Copied to Clipboard!
SpiritSephiroth
07/26/21 7:11:28 PM
#111:


1337toothbrush posted...
The example I gave shows you a way of handling it.

Shit, I see it. Thanks!

---
... Copied to Clipboard!
SpiritSephiroth
07/27/21 8:45:40 PM
#112:


Bump, started on Definitions again. Want to make sure I got my head around it.

---
... Copied to Clipboard!
1337toothbrush
07/27/21 9:58:22 PM
#113:


... Copied to Clipboard!
SpiritSephiroth
07/28/21 8:08:55 PM
#114:


1337toothbrush posted...
Definitions? Definitions of what?

Using the Def functions.

---
... Copied to Clipboard!
1337toothbrush
07/28/21 10:37:54 PM
#115:


... Copied to Clipboard!
SpiritSephiroth
07/28/21 10:43:35 PM
#116:


1337toothbrush posted...
Defining a function?

Yeah when you start off with 'Def'.

Sorry if I'm explaining it wrong, still trying to get the terminology right aswell.

---
... Copied to Clipboard!
1337toothbrush
07/28/21 10:49:11 PM
#117:


Yes, functions are very important in programming so it's good that you're familiarizing yourself with them. Like in my example, you can see the benefit of structuring your program with reusable functions.

---
... Copied to Clipboard!
SpiritSephiroth
07/29/21 10:11:30 PM
#118:


I think my data got wiped. We had a power outage last night because of some emergency works outside and now when I check my file half my damn code isnt there.

---
... Copied to Clipboard!
SomeLikeItHoth
07/30/21 7:02:14 PM
#119:


SpiritSephiroth posted...
I think my data got wiped. We had a power outage last night because of some emergency works outside and now when I check my file half my damn code isnt there.
Thats terrible. I hate losing code.

---
FAM FOREVER.
... Copied to Clipboard!
1337toothbrush
07/30/21 7:39:32 PM
#120:


This might be a good time to get into the habit of using version control. Sign up to github and upload your code for free.

---
... Copied to Clipboard!
COVxy
07/30/21 7:41:00 PM
#121:


1337toothbrush posted...
This might be a good time to get into the habit of using version control. Sign up to github and upload your code for free.

This. Git is awful, but also awesome.

---
=E[(x-E[x])(y-E[y])]
... Copied to Clipboard!
SpiritSephiroth
07/31/21 10:14:16 PM
#122:


My friend told me to make an account there too but totally forgot. Will do that in the morning.

---
... Copied to Clipboard!
SomeLikeItHoth
08/01/21 6:11:54 AM
#123:


... Copied to Clipboard!
SpiritSephiroth
08/01/21 7:08:32 PM
#124:


... Copied to Clipboard!
1337toothbrush
08/01/21 7:56:44 PM
#125:


Honestly, as dumb as JavaScript can be, I actually prefer it over Python. You can use for the web frontend (there is a way to do this with Python, but it's not feature complete and kinda cumbersome) and backend. JavaScript also runs faster than Python because so much work has been poured into optimizing the runtime. With ECMA6, it's not half-bad. Heck, you can use TypeScript to get type information.

---
... Copied to Clipboard!
SpiritSephiroth
08/02/21 10:53:02 PM
#126:


1337toothbrush posted...
Honestly, as dumb as JavaScript can be, I actually prefer it over Python. You can use for the web frontend (there is a way to do this with Python, but it's not feature complete and kinda cumbersome) and backend. JavaScript also runs faster than Python because so much work has been poured into optimizing the runtime. With ECMA6, it's not half-bad. Heck, you can use TypeScript to get type information.

That reminds me. At what point should I move onto another code? I don't mean leaving python, but I mean looking into other programs like Javascript or C++? Do people spend years on one program before moving on or do they learn them side-by-side?

---
... Copied to Clipboard!
1337toothbrush
08/02/21 11:32:50 PM
#127:


SpiritSephiroth posted...
That reminds me. At what point should I move onto another code? I don't mean leaving python, but I mean looking into other programs like Javascript or C++? Do people spend years on one program before moving on or do they learn them side-by-side?
It's best to stick with a single language to learn at least the basics. However, you may want to look at other languages to see if they make more sense to you to help you learn faster. Just be careful not to get distracted and go all over the place without making progress.

---
... Copied to Clipboard!
Questionmarktarius
08/03/21 10:42:37 AM
#128:


SpiritSephiroth posted...
At what point should I move onto another code?
Whenever you have to, or at least get curious.
If you know one, you can half-ass your way though others. Especially so for the "C-style" ones. Most of the adaptation is in learning what includes (or whatever the language calls them) are nigh mandatory at the top, if needed at all.
... Copied to Clipboard!
SpiritSephiroth
08/03/21 10:29:54 PM
#129:


1337toothbrush posted...
It's best to stick with a single language to learn at least the basics. However, you may want to look at other languages to see if they make more sense to you to help you learn faster. Just be careful not to get distracted and go all over the place without making progress.

Questionmarktarius posted...
Whenever you have to, or at least get curious.
If you know one, you can half-ass your way though others. Especially so for the "C-style" ones. Most of the adaptation is in learning what includes (or whatever the language calls them) are nigh mandatory at the top, if needed at all.

Yeah I'll be sticking with Python for a while before touching new code programs.

---
... Copied to Clipboard!
SomeLikeItHoth
08/03/21 10:35:20 PM
#130:


SpiritSephiroth posted...
That reminds me. At what point should I move onto another code?
I'd give it another month or two. You don't want to overwhelm yourself.

https://www.amazon.com/HTML-CSS-Design-Build-Websites/dp/1118008189

I picked up this book today at a book store. I'll let y'all know how it is.

---
FAM FOREVER.
... Copied to Clipboard!
1337toothbrush
08/03/21 10:40:40 PM
#131:


HTML and CSS are just the visual aspects. You'll want to learn JavaScript if you want to do anything significant with that stuff (unless you plan on doing everything in the backend, in which case you'll need to pick up a backend programming language).

---
... Copied to Clipboard!
SpiritSephiroth
08/04/21 10:30:33 PM
#132:


I passed by Waterstones the other day and saw a few books on Python. Most of them were still dealing with Python 2.

I guess Amazon would be my best bet if I wanted to buy.

---
... Copied to Clipboard!
#133
Post #133 was unavailable or deleted.
1337toothbrush
08/04/21 10:59:47 PM
#134:


SpiritSephiroth posted...
I passed by Waterstones the other day and saw a few books on Python. Most of them were still dealing with Python 2.

I guess Amazon would be my best bet if I wanted to buy.
I never learned any programming from a book. I find it's easier to just follow things online. Python 2 is obsolete anyway.

---
... Copied to Clipboard!
SpiritSephiroth
08/05/21 5:54:13 PM
#135:


Mr Hangman posted...
You guys might enjoy the Advent of Code challenges. It's done every year in December, but you can go back and do previous years any time.

https://adventofcode.com/

They can be done in any language, but Python is the most popular. Python is well suited to rapid prototyping and experimentation, or for individualized and occasional tasks. It's not as well suited for infrastructure work or professional final products, but lots of people who can take advantage of coding aren't doing that sort of work.

This looks interesting, thanks I'll check this out.

1337toothbrush posted...
I never learned any programming from a book. I find it's easier to just follow things online. Python 2 is obsolete anyway.

Yeah I've been doing that mostly. Also with the free Udemy courses I got from this topic (Thanks to Somelikeithoth).

---
... Copied to Clipboard!
SomeLikeItHoth
08/05/21 10:51:42 PM
#136:


On August 23rd there's a 12 week programming bootcamp that covers html and css. It's completely free & offers a certificate. It's also designed for people who don't have any programming experience so don't be shy. If anyone wants to learn then check out the link. You'll have to dedicate minimum 10 hours a week on the program if you want to succeed.

https://www.classcentral.com/report/webdev-bootcamp/

[LFAQs-redacted-quote]

That's cool. I'll have to remember that. Right now I'm doing the roguelite dungeon builder on Reddit. They do it every summer.

---
FAM FOREVER.
... Copied to Clipboard!
SpiritSephiroth
08/06/21 9:37:15 PM
#137:


SomeLikeItHoth posted...
On August 23rd there's a 12 week programming bootcamp that covers html and css. It's completely free & offers a certificate. It's also designed for people who don't have any programming experience so don't be shy. If anyone wants to learn then check out the link. You'll have to dedicate minimum 10 hours a week on the program if you want to succeed.

Whoa that sounds tempting. Im gonna look into it thanks.

---
... Copied to Clipboard!
SpiritSephiroth
08/07/21 8:11:30 PM
#138:


Trying to wrap my head around some code is both fustrating and rewarding at the same time.

---
... Copied to Clipboard!
Questionmarktarius
08/07/21 9:26:13 PM
#139:


SpiritSephiroth posted...
Trying to wrap my head around some code is both fustrating and rewarding at the same time.
It's even worse when it's your own code.
... Copied to Clipboard!
CobraGT
08/07/21 10:07:26 PM
#140:


I have wanted to learn python so it helps to see someone else do it.

---
... Copied to Clipboard!
SpiritSephiroth
08/08/21 9:55:23 PM
#141:


I'm gonna post more code here when I have a breakthrough. I don't think I want to keep posting the same type of code unless I learn something major for myself personally.

---
... Copied to Clipboard!
1337toothbrush
08/09/21 3:36:47 PM
#142:


SpiritSephiroth posted...
Trying to wrap my head around some code is both fustrating and rewarding at the same time.
If you have any questions about a piece of code, post it here and I can step you through it if you'd like.

---
... Copied to Clipboard!
SpiritSephiroth
08/09/21 9:07:46 PM
#143:


1337toothbrush posted...
If you have any questions about a piece of code, post it here and I can step you through it if you'd like.

Thanks, I'll do that. I appreciate it!

---
... Copied to Clipboard!
SomeLikeItHoth
08/10/21 12:16:37 PM
#144:


I didnt do anything yesterday after work. I just slept when I got home.

---
FAM FOREVER.
... Copied to Clipboard!
SpiritSephiroth
08/10/21 10:10:51 PM
#145:


SomeLikeItHoth posted...
I didnt do anything yesterday after work. I just slept when I got home.

Thats going to be me tomorrow. Going to be out for most of the day but I'll try to put some work in when I get home, even though it might be late.

---
... Copied to Clipboard!
SpiritSephiroth
08/11/21 7:56:49 PM
#146:


As I thought, got home really late. I'll pick up some more tomorrow.

---
... Copied to Clipboard!
SomeLikeItHoth
08/12/21 5:59:36 PM
#147:


I ended up watching a few episodes of Arrow last night and I also watched Luca on Disney+. I'm still going to do my daily lesson today and tomorrow, but starting Saturday I'm on vacation and there's a few books I need to catch up on!

---
FAM FOREVER.
... Copied to Clipboard!
SpiritSephiroth
08/13/21 2:45:53 PM
#148:


SomeLikeItHoth posted...
I ended up watching a few episodes of Arrow last night and I also watched Luca on Disney+. I'm still going to do my daily lesson today and tomorrow, but starting Saturday I'm on vacation and there's a few books I need to catch up on!

I was really sleepy today but managed to slog through and practice some codes.

Still really stuck on how to exit a while loop and satisfy a condition with this code I'm doing. Im gonna tough it out on my own a bit.

If I still need help I might ask here soon.

---
... Copied to Clipboard!
SpiritSephiroth
08/13/21 10:52:16 PM
#149:


Okay I actually figured it out. It was so simple I feel stupid, but at least its progress.

---
... Copied to Clipboard!
SpiritSephiroth
08/14/21 8:10:35 PM
#150:


Bump, started on a new exercise, but Python has been running slow on my computer recently. And not just that, everything has. Need to clean my computer out and check for viruses.

---
... Copied to Clipboard!
Topic List
Page List: 1, 2, 3, 4, 5, 6, 7 ... 10