great tutorial, could you extend it to explain multiple operators like (n + n) * n?
@SimpleEasyPython2 күн бұрын
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.
@michaelmerriott21552 күн бұрын
@@SimpleEasyPython I agree, eval feels cheap and dirty to me. Thanks for your time.
@MightyBaja5 күн бұрын
I was stuck on unit test, until this video..thanks a lot
@SimpleEasyPython5 күн бұрын
Glad that you found the video helpful. Happy Coding ...
@ShubhamDahal-h5d8 күн бұрын
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()
@SimpleEasyPython8 күн бұрын
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.
@luckycsgo284510 күн бұрын
i asked chatgpt to make a dictionary for me and it, my code wasnt functioning on that dictionary
@SimpleEasyPython10 күн бұрын
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Ай бұрын
hello can you help with the final project?
@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Ай бұрын
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Ай бұрын
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Ай бұрын
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Ай бұрын
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Ай бұрын
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Ай бұрын
Thanks. Glad that you found the video helpful. Happy Coding ....
@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Ай бұрын
Glad that you found the solution helpful. Happy Coding ...
@sweetiepiedpiperrАй бұрын
Thanks so much!! 🙏🙏
@SimpleEasyPythonАй бұрын
Happy that you found the video helpful. Happy Coding ...
@sweetiepiedpiperrАй бұрын
Great video, thank you so much!!
@SimpleEasyPythonАй бұрын
Glad that you found the solution helpful. Happy Coding ...
@sweetiepiedpiperr2 ай бұрын
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Ай бұрын
Glad that you found the solution helpful. Happy Coding ...
@EducationWithDominik2 ай бұрын
Thank you very much, love how you explained it. Keep it up my friend. Deserved a follow :) Best Wishes
@SimpleEasyPython2 ай бұрын
Glad that you found the solution helpful. Thanks for the sub.
@ingega2 ай бұрын
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
@ingega2 ай бұрын
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 !!!!
@SimpleEasyPython2 ай бұрын
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.
@ironmonkey19902 ай бұрын
thank you!
@SimpleEasyPython2 ай бұрын
I'm glad that you found the video helpful. Happy coding !!!
@uzairshahid78543 ай бұрын
@SimpleEasyPython please go over Problems set 8. Thank you!
@SimpleEasyPython3 ай бұрын
Recording in progress for Problem Set 8 Seasons of Love. Hope to release it next Monday 7th October.
@ironmonkey19903 ай бұрын
thank you!
@SimpleEasyPython3 ай бұрын
Glad that you found the video helpful. Happy coding !!!
@almamunjibon3 ай бұрын
test your code with 9 AM to 5 AM . i think there is a problem with this input.
@SimpleEasyPython3 ай бұрын
I am getting 09:00 to 05:00 as output. What are you getting the output ?
@janv.leiden3 ай бұрын
good video sir, but what if the 0 isnt at the 2nd position but still the first number?
@SimpleEasyPython3 ай бұрын
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.leiden3 ай бұрын
@@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.
@SimpleEasyPython3 ай бұрын
Thanks. I have shared the link for CS50P playlist and Python Playlist in the description. You may want to check them.
@shivasharma87793 ай бұрын
thankuu sir 😊
@SimpleEasyPython3 ай бұрын
Glad that you found the video solution helpful. Happy Coding !!!
@shivasharma87793 ай бұрын
thanks a lot sir !!💓💖
@SimpleEasyPython3 ай бұрын
Glad that you found the video helpful. Happy Coding !!!
@herncabret4 ай бұрын
what does the __name__ == "__main__ ": part do? Also thanks for the video
@SimpleEasyPython4 ай бұрын
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.
@tanayshankar49384 ай бұрын
Great Video👏, Very Comprehensive and To The Point Tutorial to a classic Pillow library usecase
@SimpleEasyPython4 ай бұрын
Glad that you found the video useful. Happy coding !!!
@NellyHambarchian4 ай бұрын
Thank you so much ❤️
@SimpleEasyPython4 ай бұрын
Glad that you found the video helpful. Happy Coding !!!
@ahumannamedmanav5 ай бұрын
Thank you so much for such a simple explanation. You just gained a subscriber. Keep making these kind of videos
@SimpleEasyPython5 ай бұрын
Thanks for your kind words. Glad that you find the video helpful. Happy Coding !!!
@countergravity63715 ай бұрын
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-hg1rc5 ай бұрын
sir can you explain why we are using for loop? cant we just print it out?
@SimpleEasyPython5 ай бұрын
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-hg1rc5 ай бұрын
@@SimpleEasyPython thank you sir, I understand now
@SimpleEasyPython5 ай бұрын
Glad that I could help. Happy coding !!!
@muoazaoo5 ай бұрын
man you are actually awesome
@SimpleEasyPython5 ай бұрын
Thanks for your kind words. I'm glad that you found the video helpful. Happy Coding !!!
@zeedankhalid40965 ай бұрын
Nice Solution keep up the good work
@SimpleEasyPython5 ай бұрын
Glad that you found the video useful. Happy Coding !!!
@Ahlęmîmi-p2c5 ай бұрын
excellent job 🥰🥰🥰🥰🥰
@SimpleEasyPython5 ай бұрын
Glad you found it useful. Happy coding !!!
@myunordinarylife5 ай бұрын
man this really helps , thanks uncle for this vdo the problesm are getting tougher