Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Trying to find the next prime number
Post: RE: Trying to find the next prime number

Yeah, I scrapped my old code in favour of some new borrowed code. This one works like a charm: num = int(input("Enter a number: ")) def is_prime(x): return all(x % i for i in range(2, x)) def ...
FirstBornAlbratross Homework 8 4,742 Aug-09-2023, 05:31 PM
    Thread: Trying to find the next prime number
Post: Trying to find the next prime number

Hi all, My exercise for today (not for school) is for the user to enter a number and then I have to find the next prime number and print it. This is what I've got so far (it doesn't work): def next...
FirstBornAlbratross Homework 8 4,742 Aug-08-2023, 07:04 PM
    Thread: Problem Calculating GPA
Post: RE: Problem Calculating GPA

Thank you guys for the quick responses! They really helped! Also, the chapter I'm on hasn't introduced dictionaries (yet). I know how to use them but I opted to try and solve the exercise without...
FirstBornAlbratross Homework 3 1,249 Apr-13-2023, 03:18 PM
    Thread: Problem Calculating GPA
Post: Problem Calculating GPA

Hey all, I have created a simple program to try to convert letter grades into a GPA score, but my program calculations are a bit off. user_grades = [] grades = str(input("Enter a grade: ('q' to end....
FirstBornAlbratross Homework 3 1,249 Apr-12-2023, 08:19 PM
    Thread: How do I check if the first X characters of a string are numbers?
Post: RE: How do I check if the first X characters of a ...

OK I figured it out. String splice + check. (menator01's solution) Simple. Thanks for the replies. All the best.
FirstBornAlbratross General Coding Help 6 1,619 Apr-11-2023, 06:05 PM
    Thread: How do I check if the first X characters of a string are numbers?
Post: How do I check if the first X characters of a stri...

How do I check if the first X characters of a string are numbers? For example if someone inputs a combination of numbers and characters, how can I check to see if the first 3 characters are numbers?
FirstBornAlbratross General Coding Help 6 1,619 Apr-11-2023, 12:58 AM
    Thread: How do I get pygame module to work in Spyder? (Mac)
Post: RE: How do I get pygame module to work in Spyder? ...

This pygame module has been a total nightmare for me to solve. I spoke to one of my friends about it and he says I can learn Python without it so that's what I'm going to do. There's no guarantee...
FirstBornAlbratross General Coding Help 18 4,637 Dec-18-2022, 06:43 PM
    Thread: How do I get pygame module to work in Spyder? (Mac)
Post: RE: How do I get pygame module to work in Spyder? ...

(Dec-17-2022, 08:08 PM)snippsat Wrote: (Dec-17-2022, 06:34 PM)FirstBornAlbratross Wrote: PermissionError: [Errno 13] Permission denied: '/Users/Tony' I still get the previous "permission" error m...
FirstBornAlbratross General Coding Help 18 4,637 Dec-17-2022, 09:00 PM
    Thread: How do I get pygame module to work in Spyder? (Mac)
Post: RE: How do I get pygame module to work in Spyder? ...

(Dec-17-2022, 11:30 AM)snippsat Wrote: (Dec-17-2022, 03:46 AM)FirstBornAlbratross Wrote: OK so after using "which python" and "python -c "import sys; print(sys.executable)"" the path is shown as: ...
FirstBornAlbratross General Coding Help 18 4,637 Dec-17-2022, 06:34 PM
    Thread: How do I get pygame module to work in Spyder? (Mac)
Post: RE: How do I get pygame module to work in Spyder? ...

OK so after using "which python" and "python -c "import sys; print(sys.executable)"" the path is shown as: /opt/miniconda3/bin/python My current interpreter is set to the above but alas I get a new ...
FirstBornAlbratross General Coding Help 18 4,637 Dec-17-2022, 03:46 AM
    Thread: How do I get pygame module to work in Spyder? (Mac)
Post: RE: How do I get pygame module to work in Spyder? ...

(Dec-16-2022, 11:53 PM)snippsat Wrote: Use command line(Terminal) and use command that show. This is basic stuff How to use the Terminal command line in macOS I guess you used command line to instal...
FirstBornAlbratross General Coding Help 18 4,637 Dec-17-2022, 02:14 AM
    Thread: How do I get pygame module to work in Spyder? (Mac)
Post: RE: How do I get pygame module to work in Spyder? ...

(Dec-16-2022, 10:54 PM)snippsat Wrote: The path is little strange try look in: /Library/Frameworks/Python.framework/Versions/3.11/python Do from this command line. which python # Or python -c "impo...
FirstBornAlbratross General Coding Help 18 4,637 Dec-16-2022, 11:25 PM
    Thread: How do I get pygame module to work in Spyder? (Mac)
Post: RE: How do I get pygame module to work in Spyder? ...

(Dec-16-2022, 09:55 PM)snippsat Wrote: (Dec-16-2022, 09:33 PM)FirstBornAlbratross Wrote: I can't find this specific path: /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-pa...
FirstBornAlbratross General Coding Help 18 4,637 Dec-16-2022, 10:12 PM
    Thread: How do I get pygame module to work in Spyder? (Mac)
Post: RE: How do I get pygame module to work in Spyder? ...

(Dec-16-2022, 09:17 PM)snippsat Wrote: (Dec-16-2022, 08:51 PM)FirstBornAlbratross Wrote: Unfortunately those set of instructions is for Windows, not mac. I'm having trouble finding the solution ...
FirstBornAlbratross General Coding Help 18 4,637 Dec-16-2022, 09:33 PM
    Thread: How do I get pygame module to work in Spyder? (Mac)
Post: RE: How do I get pygame module to work in Spyder? ...

(Dec-16-2022, 08:16 PM)deanhystad Wrote: google "spyder set python interpreter". This is more about setting up a virtual environment, but it does discuss how to set the python interpreter. https...
FirstBornAlbratross General Coding Help 18 4,637 Dec-16-2022, 08:51 PM
    Thread: How do I get pygame module to work in Spyder? (Mac)
Post: How do I get pygame module to work in Spyder? (Mac...

Hey everyone, My question is how do I get the pygame module to work in Spyder? pygame is already installed in this path: /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packa...
FirstBornAlbratross General Coding Help 18 4,637 Dec-16-2022, 07:41 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020