Jump to content
N-Europe

Recommended Posts

Posted
4 hours ago, Happenstance said:

I feel like I always see Americans going on about using Slack but rarely anyone over here.

It seems to be big in the tech sphere but our team was happy to just use whatever the name of outlook's chat app was pre-Teams. We were mostly just bitching about other people in the office after all. 

Posted

Was gonna look for the Jobs thread of the good stuff but saw this and thought might be appropriate here.

Been doing an Oracle Database SQL (1Z0-071) course for the last 5 months, took the exam today.

PASSED with 74%, certified baby :D  (63% is the min)

Just waiting for Oracle to cough up the official cert for it now, which can apparently take up to 48 hours....

Bloody hell was it a tough exam though, questions were a lot harder than any of the practice exams the course gave me. I was slowed down on a lot of questions just reading stuff over and over to try get things right in my head. 2 hour exam, finished it with just 14 seconds left. Think when I was down to the last 10 questions I only had like 11 mins left and panicked a little, tried to speed up and then paranoid I'd be getting stuff wrong if I wasn't reading properly. 

When I was pressing the last button that would grade the exam I was fully prepared to see a fail result come up, was delighted to see it saw Pass and to see the score was a good 11% in the clear :)

Totally drained after that course and wrecked after the exam. Gonna take a few weeks to enjoy the summer with the kids, then planning to do a Python course as a lot of Job adverts I see for SQL are also looking for Python so will probably be a good idea to have both on the CV and hopefully soon it'll all help me give two fingers to the current job :p 

  • Like 4
Posted

I reckon the best python resource is probably https://diveintopython3.net/ - especially if you already know other languages, but even if not (though it might be a bit fast).

In general if you're starting out it's very hard to learn without trying to achieve a concrete task - so coding problem based websites can help a lot here (see https://www.codingame.com/start for one that might appeal to this audience), but also having a bigger project like building some kind of application is possibly even more useful.

  • Like 1
Posted

Yeah there's only so far you should go with copying tutorials. The best way to learn is think of a small-level thing you want to achieve and approach it like a learning project. 

I always say the biggest problem when starting out is not knowing what you don't know, meaning you don't know what's possible. It gets a bit easier when you know one language as you start to get a sense but best to just assume something can be done and Google the hell out of it. 

Posted
On 7/28/2022 at 8:34 AM, Ashley said:

The best way to learn is think of a small-level thing you want to achieve and approach it like a learning project. 

I recently thought of one and I think it's possible to do with Python. It's a little game I thought of (which may or may not have been done before).
I do wonder, though, how difficult it would be to create a visual representation of it. You know...like in actual video games :D 

Anyways, I've reached Boolean logic, if statements, else statements and all that jazz now. If I understand correctly, this will help me put that game idea into practice.

Posted

Ultimately, all coding logic and constructions can be boiled down to ifs and loops but it quickly becomes very cumbersome to read and maintain. But it shows how important understanding those two concepts is. 

  • Thanks 1
Posted

Signed up to a beginner Python course, online, have 16 weeks to complete, cert from Certiport at the end of it....should go well, fingers crossed

  • Like 1
  • 2 weeks later...
Posted

Haven't done anything for a while, but got a question before I get back to it:

I'm using Visual Studio Code while following some lessons, writing code that I just learned and trying things out with it. But I manually have to execute the code and I still don't really understand how exactly it works (with the Terminal and all that jazz).

Is there a kind of "playground" that I could set up? Something that automatically executes code as soon as it's written down? Is something like this even possible/sensible?

Posted (edited)
1 hour ago, drahkon said:

Is there a kind of "playground" that I could set up? Something that automatically executes code as soon as it's written down? Is something like this even possible/sensible?

I don't know exactly how you imagine this, but the program needs to interpret what you've written first, and the way you describe it, it would have to interpret and execute all of your code every single time you type a character. It's suffice to say that's highly impractical.

Edited by Sméagol
Posted (edited)
13 minutes ago, Sméagol said:

I don't know exactly how you imagine this, but the program needs to interpret what you've written first, and the way you describe it, it would have to interpret and execute all of your code every single time you type a character. It's suffice to say that's highly impractical.

Yeah, I worded it a bit weird.

I wanted to execute code that I've just written with a simple command or rather shortcut.
Figured out a way in Visual Studio Code. Now I can just highlight certain lines of code, press "Shift + Enter" and that code is executed in an interactive window. :) 

By the way: fuck the "not operator". It's "double negative" in code and I hate it already :p 

Edited by drahkon
Posted (edited)
23 minutes ago, drahkon said:

I wanted to execute code that I've just written with a simple command or rather shortcut.
Figured out a way in Visual Studio Code. Now I can just highlight certain lines of code, press "Shift + Enter" and that code is executed in an interactive window. :) 

That sounds useful, but know how to read your errors. If you're just going to test a snippet of code, know how to distinguish between errors that show something's wrong with the code (like a simple syntax error), or errors that show up because the snippet of code is relying on data from outside that snippet.

23 minutes ago, drahkon said:

By the way: fuck the "not operator". It's "double negative" in code and I hate it already :p 

Get used to it, because it's very useful. Sometimes you want to trigger code on the condition that something not true for example.

Edit:

Now I feel like doing some programming myself. Maybe I should finally make a website.

Edited by Sméagol
  • Thanks 1
Posted (edited)
19 hours ago, Sméagol said:

That sounds useful, but know how to read your errors. If you're just going to test a snippet of code, know how to distinguish between errors that show something's wrong with the code (like a simple syntax error), or errors that show up because the snippet of code is relying on data from outside that snippet.

Haven't had any errors so far.
Just kidding, soooo many errors. Always syntax, though.

Edit: Aaaaand some new errors arise. :laughing: Man, I need to get into the problem-solving mindset of a coder. Gotta look up some resources on that.

19 hours ago, Sméagol said:

Get used to it, because it's very useful. Sometimes you want to trigger code on the condition that something not true for example.

:( I hate double negatives no matter where they turn up. Guess I just gotta live with it :p 

Doing a small lesson on loops now. Doing my head in already.

Edited by drahkon
Posted (edited)

Need help...gotta make a BMI calculator.

Spoiler

BMI Calculator



Tracking your BMI is a useful way of checking if you’re maintaining a healthy weight. It’s calculated using a person's weight and height, using this formula: weight / height²

The resulting number indicates one of the following categories:
Underweight = less than 18.5
Normal = more or equal to 18.5 and less than 25
Overweight = more or equal to 25 and less than 30
Obesity = 30 or more

Let’s make finding out your BMI quicker and easier, by creating a program that takes a person's weight and height as input and outputs the corresponding BMI category.

Sample Input
85
1.9

Sample Output
Normal

Spoiler
weight = int(input("Your weight"))
height = float(input("Your height"))
BMI = weight/height**2
 
if BMI < 18.5:
    print("Underweight")
elif BMI >= 18.5 and BMI < 25:
    print("Normal")
elif BMI >= 25 and BMI < 30:
    print("Overweight")
elif BMI >= 30:
    print("Obese")

And here's what I get when I run the code via the Sololearn page:

Untitled.jpg

However, when I run the code on VS Code it works just fine:

2.jpg

Edit: When I remove "Your weight" and "Your height" in input() it goes through as "correct". I wonder why it outputs the strings on Sololearn but not in VS Code.

Edited by drahkon
Posted

Are they expecting you to pass the input values as command line arguments instead?

The problem here is that the input strings are printed to the screen so it's not matching the expected output.

Posted
2 minutes ago, Ike said:

Are they expecting you to pass the input values as command line arguments instead?

I don't know how to answer that :laughing: 

2 minutes ago, Ike said:

The problem here is that the input strings are printed to the screen so it's not matching the expected output.

Yeah, I wonder why, though.
As I mentioned in my edit above, when I remove the strings, it works fine.

Posted

I didn't see your edit. I was going to suggest that but it seemed silly as the script will be waiting for user input but the user won't know what to enter. :heh:

Your objective text is pretty vague so I assume you had some sort of lesson beforehand to give you a clue?

Not sure what VSC is doing. Is that some sort of unit test?

Posted
Just now, Ike said:

Your objective text is pretty vague so I assume you had some sort of lesson beforehand to give you a clue?

The objective is the "Code Project" of the "Control Flow" section of the Python course. Learned about boolean logic, if and else statements and loops.
It's just a little exercise to put what I've learned into practice.

2 minutes ago, Ike said:

Not sure what VSC is doing. Is that some sort of unit test?

I use "Run Selection/Line in Interactive Window" to run the code. It lets me input the necessary values and outputs the result.
It works completely fine there. An input window opens up with "Your weight" and after that another one with "Your height". Once the inputs are down it prints the BMI (normal, underweight, etc). 

I'd say, my code is fine (spoken like a true coder, I assume? :p) but somehow the Sololearn terminal does something weird?

Posted
12 minutes ago, drahkon said:

I use "Run Selection/Line in Interactive Window" to run the code. It lets me input the necessary values and outputs the result.

It works completely fine there. An input window opens up with "Your weight" and after that another one with "Your height". Once the inputs are down it prints the BMI (normal, underweight, etc). 

I'd say, my code is fine (spoken like a true coder, I assume? :p) but somehow the Sololearn terminal does something weird?

Ah. Run your script from the command line and you'll see why, VSC has added a fancy prompt dialog so the input text isn't actually output to the terminal.

python3 "BMI calculator.py"

Your code is correct in that it does what they asked you, it's just not in the format sololearn is expecting, but they aren't explaining exactly how they want it done.

Posted
1 minute ago, Ike said:

Ah. Run your script from the command line and you'll see why, VSC has added a fancy prompt dialog so the input text isn't actually output to the terminal.

python3 "BMI calculator.py"

Ah, so that's possible, too.
Works just fine there as well. Only without the fancy prompt dialogue, of course. It Just asks for the input in the terminal (Your weight and then Your height).

2 minutes ago, Ike said:

Your code is correct in that it does what they asked you, it's just not in the format sololearn is expecting.

Interesting.
It's a good thing then, that I tried it on both platforms.

Thanks for the help :) 

Posted
4 minutes ago, drahkon said:

Ah, so that's possible, too.
Works just fine there as well. Only without the fancy prompt dialogue, of course. It Just asks for the input in the terminal (Your weight and then Your height).

So that's what sololearn is seeing which is why it's failing as it's seeing all that extra output in the screen and only wants to see the BMI value.

Using the command line arguments would get rid of the extra text because otherwise I don't know how they are passing the input values in their tests.

  • 2 months later...
Posted

name = "Mokong"
score = 81.5

if score >= 70:
    print(f"{name} has passed his Python exam today")
    print(f"With a score of {score}%")
    print("And is certified an IT Specialist in Python by Certiport")
else:
    print("Try again, no certification for you or your CV!")
 

https://twitter.com/MokongX3M/status/1588180505219964928?s=20&t=Q5a513xEsJIrxEJT6Pp-jw

 

Added a Python cert to my two SQL certs, all three done in a year! :D

Now if I can just find a work place looking to hire someone who only has certs and 0 years previous working experience I'll be sorted..... :p 

 

 

  • Like 2
  • 3 months later...
Posted

So I made this:

triangles.svg

And I'm kind of amazed this forum allows you to embed this.

So why am I posting an image in a coding thread you ask? Well, that's because no graphical software has been used in creating it. This was all done in notepad++. I'm also trying to learn some Python, never used it before until a few months ago, and it comes with my raspberry pi anyway (although updating is took quite some effort). I used Python to randomly generate a triangle a certain position. I needed some vector graphics as a decoration. Suffice it to say, this would be a chore to do manually.

Posted
2 hours ago, Sméagol said:

So I made this:

triangles.svg

And I'm kind of amazed this forum allows you to embed this.

 

It doesn't. Or at least, it isn't loading for me. You can right click and open the url in another tab though, and it loads.

×
×
  • Create New...