Rookie question - why is the answer to this formula a float?

Hi, i have just started the PCEP course from python, and in the module 2 section the following formula displays the answer as a float, when in fact the last part of the formula is " **//**2" which should display a integer “10” instead of “10.0”, and I’m just trying to understand to better my understanding. any help appreciated, TY

Input
print((5 * ((25 % 13) + 100) / (2 * 13)) // 2)

Output
10.0

It has a single / which returns a float.

// returns a whole number, but it returns an integer only if both of the numbers are integers:

>>> 3 // 2
1
>>> 3.0 // 2
1.0
2 Likes

Gotcha…thanks a lot :slight_smile:

What is “the PCEP course from python”?

PCEP – Certified Entry-Level Python Programmer

I can’t really speak for others but in all my resume-looking / hiring experience, these certs have never held any weight at all. I think the name “Python Institute” makes it sound like an official thing from the PSF or similar, but as far as I know: it isn’t.

4 Likes

Yeah, doesn’t look like that is “from python”. Looks like trademark infringement which the PSF should do something about.

1 Like

The course it self is on the official python website: https://pythoninstitute.org/.

This particular course:
https://pythoninstitute.org/python-essentials-1

But anyway, what did work for you, what do you recommend?

oh i see the website is python"institute".org, thanks for letting me know

1 Like

For me it was pet projects and then doing well in coding interviews. Practice makes perfect.

And that’s exactly why the PSF pursues trademark violations. It really does cause confusion as to what is the “official Python website”.

4 Likes

But did you do a course to teach you how to do those pet projects?
Also did you start or recommend Python or something els?

ty

For me it was a computer programming class in high school, then that led to a BS in Computer Science.

Python was just so much fun compared to C++/Java/C# I had used before.

I’ve heard that some free classes MIT offers are good for folks starting out: Introduction to Computer Science and Programming in Python | Electrical Engineering and Computer Science | MIT OpenCourseWare. Otherwise, there are plenty of free tutorials.

Edit: As a side note VB .NET was fun in high school but for different reasons.

1 Like

Thanks for the link. There can be no objection to people being paid for teaching Python (although lots of that can be got for free). Caveat emptor, and all that.

One of the uses that the PSF claims to control is including “Python” in the name of a company. I also notice the logo badging a few items. Can we draw the attention of @psf-staff like this?

If you are planning a career then focus on programming skills over learning one specific language. Python is a great place to start, however expect to want to know how to use other languages in the future.

Thanks a lot for your help

Yes for sure i want to make it a career, but the first aim is to become good enough to land a job and get a foot in the door, and it seems the best first choices are either Python or Java from what i read online.

So far most people are saying my best bet is to start working on projects and learning that way rather than certificates etc

It will be faster to become a useful software engineer with python then Java.
I agree that the certification is not worth much. In an interview you would have to
show your know python.

Beyond that problem solving skills will make you stand out.
When I was hiring engineers we would ask candidates to outline how they would solve a problem. That allowed us to find out how they communicate, think and if they where willing to ask questions of us.

Thanks a lot for that Barry