Recent content by Taylor_1989

  1. T

    Leetcode 728 complier issue with mutliple functions

    Well, I thought it would be the last thing to run. As the other two functions have to be initialised before it for the function to run as a whole.
  2. T

    Leetcode 728 complier issue with mutliple functions

    Not in entirely, I not really covered oo atm, and tbh never had to use it when done any past question I have done on Leetcode.
  3. T

    Leetcode 728 complier issue with mutliple functions

    I am not asking for the answer, my sol works fine as was demonstrated. I don't understand why it works fine on the online compiler and not on there.
  4. T

    Leetcode 728 complier issue with mutliple functions

    I just submitted a solution for a leetcode problem, displayed below. My solution is broken into three separate functions as shown below. def Checker(dig, number): """ Purpose: Function check if the given number is divisible by each digit in the given number. Parameters...
  5. T

    Python Why Order Matters in an 'and' Statement

    First thank for the input, I can't believe I didn't think of using a slice method, thank you. To be honest I am just doing the leetcode problems, not for interview practice but more to learn about the python language itself. Also yes I agree my variable names should be more descriptive make...
  6. T

    Python Why Order Matters in an 'and' Statement

    Ah okay, I can see now thank you. Also, I am not aiming at splitting the given string. Basically I have to use a dictionary to convert there given string to a bunch of letter i.e decrypt the message, in this case, a-i is given the numbers 1-9 and j-z onwards is given by 10#, 11#,12#, etc. I...
  7. T

    Python Why Order Matters in an 'and' Statement

    I am currently doing a leet code problem and came across something, I have not noticed before. Here is a sample of the code I am working on. s = "10#11#12" A=[] B=[] i=0 count=0 while i < len(s): if i+2<len(s) and s[i+2]=='#': A+=[(s[i]+s[i+1]+s[i+2])] i+=3 print(i)...
  8. T

    Velocity equation for a cyclindrical tank and long pipe

    I didn't at the time it was about transient motion, but after reading your comment I did a little bit more research and came across the Unsteady Bernoulli Equation which has to do with transient motion, I am not sure if this will result in the given equation that I posted above but it does seem...
  9. T

    Velocity equation for a cyclindrical tank and long pipe

    I was not really sure as to whether to ask this question here or the h/w forum as its something I am personally trying to understand. However, I shall let the admin decided. The question comes from a book called : . The specific question I have an issue with is not the question itself but the...
  10. T

    Find Experimental Datasets for Python Modeling

    I did check the Data.gov site but didn't really find anything that I was looking specifically, but the UC database is very interesting. Thank for the link.
  11. T

    Find Experimental Datasets for Python Modeling

    I am currently looking to improve my python skills and looking for some projects to do, one which came to mind was experimentally modeling in python. What I like to do is code an experiment say period of a pendulum and then compare the model to some data obtained in the lab, issue is I don't...
  12. T

    XOR algorithm to find the missing number in a given array

    Recently I have been reading up about the logical operations OR, AND and XOR. Whilst reading about XOR I cam across a method using XOR to find the missing number in a given array, but I just can't understand how or really why it works. The algorithm is displayed below. A = [2, 3, 1, 4, 6, 7]...
  13. T

    What Is the Probability of Drawing a Specific Marble Color Sequence?

    The clue in this question is that you know that the second marbel is white. Imagine that when you pick the first marble, which you don't know and place in a black box, then second marble you pick is white. So now you are left with a marble in the urn and a marble in the black box. What is the...
  14. T

    Python Finding the day from a given date

    The index slice is being used to read the year and month and day from the string as u mentioned. I am now slightly confused to how my slicing produces the desired result for the year as you are right the index [0:3] should read the first four characters of the string '2018' however when I run...
  15. T

    Python Finding the day from a given date

    Okay if my indexing is wrong then my algorithm is indeed incorrect, because with the indexing I was using I was getting the correct day, back the drawing board. I got the algorithm from https://en.wikipedia.org/wiki/Zeller%27s_congruence Sorry I spelt it wrong I ment Zeller, my apologies
Back
Top