Final Project CS50P - Cookie Jar
37:36
Final Project CS50P - Calculator
21:09
Пікірлер
@michaelmerriott2155
@michaelmerriott2155 2 күн бұрын
great tutorial, could you extend it to explain multiple operators like (n + n) * n?
@SimpleEasyPython
@SimpleEasyPython 2 күн бұрын
Of course, it can be extended but it will require a lot of permutation and combination of all the possible scenarios and symbols. Furthermore, it will not fit then to the CS50P problem. So may be in another video. In the meanwhile, you can try eval function although I do not really prefer it.
@michaelmerriott2155
@michaelmerriott2155 2 күн бұрын
@@SimpleEasyPython I agree, eval feels cheap and dirty to me. Thanks for your time.
@MightyBaja
@MightyBaja 5 күн бұрын
I was stuck on unit test, until this video..thanks a lot
@SimpleEasyPython
@SimpleEasyPython 5 күн бұрын
Glad that you found the video helpful. Happy Coding ...
@ShubhamDahal-h5d
@ShubhamDahal-h5d 8 күн бұрын
hi so this is the solution I came up with and I was wondering if it was possible to give the variables dividend and divisor their values on the same line? def main(): while True: try: number = input("Fraction: ").split("/") dividend = int(number[0]) divisior = int(number[1]) answer = dividend/divisior z = round(answer*100) if dividend <= divisior: if answer <= 0.01: print("E") break elif z >= 99: print("F") break else: print(f'{z}%') break else: pass except (ValueError, ZeroDivisionError): pass main()
@SimpleEasyPython
@SimpleEasyPython 8 күн бұрын
Good question, indeed. Yes, this is possible. I think passing more than one value has been taught in later weeks. For example, dividend, divisor = (input("Fraction: ").split("/")) If you enter, 2/3, then 2 is assigned to dividend and 3 to divisor. But it will be in str format.
@luckycsgo2845
@luckycsgo2845 10 күн бұрын
i asked chatgpt to make a dictionary for me and it, my code wasnt functioning on that dictionary
@SimpleEasyPython
@SimpleEasyPython 10 күн бұрын
Can't say anything about the code without having a look into it. May be some modification is required. Anyways, chat GPT always puts a disclaimer to check facts before using it. Happy coding ...
@Lavashak22
@Lavashak22 Ай бұрын
hello can you help with the final project?
@SimpleEasyPython
@SimpleEasyPython Ай бұрын
I think you are talking about CS50P final project. My sincere advice is that if you have time, go for a complex project, may be like GUI calculator, Hangman Game etc. I did not had luxury of time so settled for a very basic calculator with four functions. If you guys want it, then I will create a video about it.
@rupalijariwala1444
@rupalijariwala1444 Ай бұрын
Hey,ur code is not working now as they have updated it Could u please make a new video of this project please? I’ll subscribe
@SimpleEasyPython
@SimpleEasyPython Ай бұрын
Thanks for your feedback. If the problem is changed, then code also need to adjusted. As far as project is concerned, I will consider creating a video. By the way, I created a very simple command line calculator since I did not had time.
@8812GG
@8812GG Ай бұрын
Are you able to put the checkers method in a separate function and return 'Valid' or 'Invalid' in one str like this? this is OOP in the next lesson and have not learned this yet, I think. very sleek looking for sure. I have been trying to stick with creating functions for everything because in the beginning of cs50 Python, I was horrible at passing variables around in them so I try to make all my code with functions to get better at them. Thank you!
@SimpleEasyPython
@SimpleEasyPython Ай бұрын
I always believe that one problem can be solved in multiple ways. I have not tried it using checker concept for this problem but I encourage you to try and share it.
@8812GG
@8812GG Ай бұрын
returning the length of the 'findall' is very clever I just added a counter in a for loop which made sense to me but this is very clever usage of python mechanics!
@SimpleEasyPython
@SimpleEasyPython Ай бұрын
Thanks. Glad that you found the video helpful. Happy Coding ....
@8812GG
@8812GG Ай бұрын
you don't need the 'else: return None' from the demonstration when you were printing the groups you said ignore the None, there for it was returning non if search didn't find what it was searching for :) nice explanation and easy to follow. also your notes are awesome. wish i could take notes like that. wow!!
@SimpleEasyPython
@SimpleEasyPython Ай бұрын
Glad that you found the solution helpful. Happy Coding ...
@sweetiepiedpiperr
@sweetiepiedpiperr Ай бұрын
Thanks so much!! 🙏🙏
@SimpleEasyPython
@SimpleEasyPython Ай бұрын
Happy that you found the video helpful. Happy Coding ...
@sweetiepiedpiperr
@sweetiepiedpiperr Ай бұрын
Great video, thank you so much!!
@SimpleEasyPython
@SimpleEasyPython Ай бұрын
Glad that you found the solution helpful. Happy Coding ...
@sweetiepiedpiperr
@sweetiepiedpiperr 2 ай бұрын
Amazing! I had been struggling with check50 for months and your video has just helped me solve this problem in 10 minutes! I have nothing but endless gratitude! :P
@SimpleEasyPython
@SimpleEasyPython Ай бұрын
Glad that you found the solution helpful. Happy Coding ...
@EducationWithDominik
@EducationWithDominik 2 ай бұрын
Thank you very much, love how you explained it. Keep it up my friend. Deserved a follow :) Best Wishes
@SimpleEasyPython
@SimpleEasyPython 2 ай бұрын
Glad that you found the solution helpful. Thanks for the sub.
@ingega
@ingega 2 ай бұрын
Ohhh finally solved, the error was that i use import datetime as dt, please don't do this (hehehe), and the other, i used the variable today=dt.date.today(), well, simply change: to_day=datetime.date.today() and that's it, finally pass all test
@ingega
@ingega 2 ай бұрын
Hello!!! my code is correct, but check50 send a parameter "today" so in check50 if date is 1999-01-01 must be "Five hundred....." bla-bla-bla, if "today" was 2001-01-01. instead my function show ("several millions...bla bla bla) that correspond to the substract of today-1999-01-01 you catch it? my function returns the exactly phrase if i use Date: 2023-10-20 (today is 2024-10-19, and is a leap year) well i use datetime.date.today() as instructions, indicates but how can i catch the input of "today" in unitest of cs50? or i can't see the way of pass this !!!!
@SimpleEasyPython
@SimpleEasyPython 2 ай бұрын
It is always good to use yesterday and day before yesterday in pytest so that the difference is 1440 and 2880 respectively as I have said in the video. Also avoid running pytest near mid-night where the day changes. Hope this helps.
@ironmonkey1990
@ironmonkey1990 2 ай бұрын
thank you!
@SimpleEasyPython
@SimpleEasyPython 2 ай бұрын
I'm glad that you found the video helpful. Happy coding !!!
@uzairshahid7854
@uzairshahid7854 3 ай бұрын
@SimpleEasyPython please go over Problems set 8. Thank you!
@SimpleEasyPython
@SimpleEasyPython 3 ай бұрын
Recording in progress for Problem Set 8 Seasons of Love. Hope to release it next Monday 7th October.
@ironmonkey1990
@ironmonkey1990 3 ай бұрын
thank you!
@SimpleEasyPython
@SimpleEasyPython 3 ай бұрын
Glad that you found the video helpful. Happy coding !!!
@almamunjibon
@almamunjibon 3 ай бұрын
test your code with 9 AM to 5 AM . i think there is a problem with this input.
@SimpleEasyPython
@SimpleEasyPython 3 ай бұрын
I am getting 09:00 to 05:00 as output. What are you getting the output ?
@janv.leiden
@janv.leiden 3 ай бұрын
good video sir, but what if the 0 isnt at the 2nd position but still the first number?
@SimpleEasyPython
@SimpleEasyPython 3 ай бұрын
Very good question. I guess you mean something like CSS05, then it should ideally fail. All I can say is CS50 seems to be little ambiguous here
@janv.leiden
@janv.leiden 3 ай бұрын
​@@SimpleEasyPython yes indeed, i was wondering about something like CSS05. i think its a little surprising that Harvard dont check for something simular, guess you found a bug in Harvard code:) Anyway, good video sir, it helped me quite alot. Im looking forward to see more content from you.
@SimpleEasyPython
@SimpleEasyPython 3 ай бұрын
Thanks. I have shared the link for CS50P playlist and Python Playlist in the description. You may want to check them.
@shivasharma8779
@shivasharma8779 3 ай бұрын
thankuu sir 😊
@SimpleEasyPython
@SimpleEasyPython 3 ай бұрын
Glad that you found the video solution helpful. Happy Coding !!!
@shivasharma8779
@shivasharma8779 3 ай бұрын
thanks a lot sir !!💓💖
@SimpleEasyPython
@SimpleEasyPython 3 ай бұрын
Glad that you found the video helpful. Happy Coding !!!
@herncabret
@herncabret 4 ай бұрын
what does the __name__ == "__main__ ": part do? Also thanks for the video
@SimpleEasyPython
@SimpleEasyPython 4 ай бұрын
Python scripts can be run without calling main as you might have observed by now. It is possible to import the current program to import as a library/module in another program, therefore, the if __name__ == "__main__" ensures that the current script is being run as main program. This concept has been explained in detail in week 6 Unit Tests.
@tanayshankar4938
@tanayshankar4938 4 ай бұрын
Great Video👏, Very Comprehensive and To The Point Tutorial to a classic Pillow library usecase
@SimpleEasyPython
@SimpleEasyPython 4 ай бұрын
Glad that you found the video useful. Happy coding !!!
@NellyHambarchian
@NellyHambarchian 4 ай бұрын
Thank you so much ❤️
@SimpleEasyPython
@SimpleEasyPython 4 ай бұрын
Glad that you found the video helpful. Happy Coding !!!
@ahumannamedmanav
@ahumannamedmanav 5 ай бұрын
Thank you so much for such a simple explanation. You just gained a subscriber. Keep making these kind of videos
@SimpleEasyPython
@SimpleEasyPython 5 ай бұрын
Thanks for your kind words. Glad that you find the video helpful. Happy Coding !!!
@countergravity6371
@countergravity6371 5 ай бұрын
It always amuses me that people cry about plagiarism in code when you can't just write whatever the hell you want and have it work. There might be multiple right answers to a problem, some better than others, but all you can really do not to "plagiarize" someone's code somewhere is to name your functions and variables something else. I would bet dollars to donuts that every single practical solution to every single problem in cs50 has been coded a million times over by now.
@IbrahimKhan-hg1rc
@IbrahimKhan-hg1rc 5 ай бұрын
sir can you explain why we are using for loop? cant we just print it out?
@SimpleEasyPython
@SimpleEasyPython 5 ай бұрын
Good question. I have used for loop so that all the items are printed on separate lines along with their frequencies. If I write only print(sorted(d.keys()),sorted(d.values()),end=" ") instead of for loop, all the item names and their frequencies will be on the same line. For example, I enter cheese, butter, cheese and then ctrl D. Output will be ['BUTTER', 'CHEESE'] [1, 2] Hope this helps. Happy coding !!!
@IbrahimKhan-hg1rc
@IbrahimKhan-hg1rc 5 ай бұрын
@@SimpleEasyPython thank you sir, I understand now
@SimpleEasyPython
@SimpleEasyPython 5 ай бұрын
Glad that I could help. Happy coding !!!
@muoazaoo
@muoazaoo 5 ай бұрын
man you are actually awesome
@SimpleEasyPython
@SimpleEasyPython 5 ай бұрын
Thanks for your kind words. I'm glad that you found the video helpful. Happy Coding !!!
@zeedankhalid4096
@zeedankhalid4096 5 ай бұрын
Nice Solution keep up the good work
@SimpleEasyPython
@SimpleEasyPython 5 ай бұрын
Glad that you found the video useful. Happy Coding !!!
@Ahlęmîmi-p2c
@Ahlęmîmi-p2c 5 ай бұрын
excellent job 🥰🥰🥰🥰🥰
@SimpleEasyPython
@SimpleEasyPython 5 ай бұрын
Glad you found it useful. Happy coding !!!
@myunordinarylife
@myunordinarylife 5 ай бұрын
man this really helps , thanks uncle for this vdo the problesm are getting tougher
@SimpleEasyPython
@SimpleEasyPython 5 ай бұрын
Glad that you find the video helpful.
@ishaa464
@ishaa464 6 ай бұрын
Thank you sir for amazing explanation
@SimpleEasyPython
@SimpleEasyPython 6 ай бұрын
Thanks
@ishaa464
@ishaa464 6 ай бұрын
Your solution is the best out there sir
@SimpleEasyPython
@SimpleEasyPython 6 ай бұрын
Thanks