Thanks for checking this out. Because the title suggests, I am a novice programmer – I began with Java years again and now largely use VBA to automate duties for my internships. I wish to graduate from VBA and get into Python/R to correctly automate duties.
The snippet of code beneath is a little bit undertaking that I wrote (first time programming with Python (PyCharm)) and I would love any of you to level out the way it might/needs to be revised (wether for propper conventions/effectivity, and many others.)
This system is supposed to soak up a time in HH:MM format and print out at what levels (from 12:00) every of the fingers will likely be at. This was tailored from a standard finance interview brainteaser information.
Thanks in your enter!
I am considering that if I get some good recommendations for this code I am going to go forward and make one that features a second hand.
input_time = enter("Please enter a time (HH:MM)") time = input_time.break up(":") clock_degrees = 360 clock_hours = 12 clock_minutes = 60 clock_degreesperhour = clock_degrees/clock_hours clock_degreesperminute = clock_degrees/clock_minutes miunte_hand_degrees = int(time)*clock_degreesperminute if (time == "12"): time = "0" hour_hand_degrees = (int(time)*clock_degreesperhour)+((int(time)/clock_minutes)*clock_degreesperhour) print("When the time is", input_time, 'the hour hand is at', hour_hand_degrees, "° and the minute hand is at", miunte_hand_degrees, "°")