Is there any need for me to write a conditional to check for a leap year?
I’m currently taking the cs50p course on edx, and I’m currently stuck on the problem set8 Seasons of Love. We were suppose to write a code that calculates the amount of years a person has lived in minutes
But my code does match there’s in the test that they gave. I’m thinking if it has to do with the year I’m currently in ????
CS50P’s Python Course. PSET 5 back to the bank [closed]
Closed 19 mins ago.
CS50P’s Python Course. PSET 5
recently started learning python from cs50p. facing issues in pset 5 problem 2 (back to the bank)
I’m trying to make a program for an airline as in (cs50 course, week 2) but there is problem i don’t understand
PS C:Usersbesho> & C:/Users/besho/AppData/Local/Programs/Python/Python312/python.exe c:/Users/besho/OneDrive/Desktop/Py/Classes.py Traceback (most recent call last): File “c:UsersbeshoOneDriveDesktopPyClasses.py”, line 19, in <module> success = flight.add_passenger(person) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “c:UsersbeshoOneDriveDesktopPyClasses.py”, line 9, in add_passenger self.add_passengers.append(name) ^^^^^^^^^^^^^^^^^^^ AttributeError: ‘Flight’ object has no attribute ‘add_passengers’. Did you mean: ‘add_passenger’? PS C:Usersbesho> class Flight(): def __init__(self, capacity): self.capacity = capacity self.passengers = [] def add_passenger(self, name): […]
In cs50 what it means by “can’t check until a frown turns upside down”?
[testing filesource file](https://i.sstatic.net/3KvOZbRl.png)
Basically I am importing functions from one file to another file and testing the function through pytest. I am using assert function to check.
This is checked by style50(from cs50).
How do I check if the next character is an alphabet after a numeric character in a for loop?
I am at the very beginning of my programming course (career change) so bear with me if this is simple. I am trying to check if the users input contains numbers in the middle of the string, as they must come at the end. E.g XXX55 is valid, XXX5X is not valid.