Search results

  1. chopnhack

    Python programming course help

    Problem 3: Alphabetical Substrings Assume s is a string of lower case characters. Write a program that prints the longest substring of s in which the letters occur in alphabetical order. For example, if s = 'azcbobobegghakl', then your program should print Longest substring in alphabetical...
  2. chopnhack

    Define a Function - brutishly

    Thanks Dan, LOL - the very same idea was presented in the next lesson! :p:D # string.upper() If I created a string to use for comparison, I could have then simply converted the case and retested. I am not sure if the test would be for each element in the string though as I had in the above...
  3. chopnhack

    Define a Function - brutishly

    LOL - My homework was completed, however, I think it was by force rather than skill: L4 Problem 10 (5/5 points) Define a function isVowel(char) that returns True if char is a vowel ('a', 'e', 'i', 'o', or 'u'), and False otherwise. You can assume that char is a single letter of any case (ie...
  4. chopnhack

    PCB Design interview questions

    Hello, I have some items that may interest you in a resource.
  5. chopnhack

    Toner transfer testing

    That is really nice pilko - 6 mil is very impressive. What paper did you use to get such a clean transfer? The image you show is for a double sided boards (there was an unconnected blind via). I would suggest adding some registration marks that you can drill through to align the flip side image.
  6. chopnhack

    Single Transistor Circuit Current Question

    I guess that depends on how deep down the rabbit hole you want to go: https://www.electronicspoint.com/threads/how-transistors-work.269828/#post-1618364 https://www.electronicspoint.com/threads/assistance-with-transistor-theory.271875/ If after reading the above and the links included in the...
  7. chopnhack

    Exchanging data variables?

    Beginners luck more likely and lots of help, but thanks none the less! I really like how you separated your statements from the logic processing - I can see what you meant in an earlier post. I just couldn't do it! I am still not comfortable with loops or nested loops - they seem simple at...
  8. chopnhack

    Exchanging data variables?

    That worked too, I moved it underneath both 'if' comparisons. Thanks :-)
  9. chopnhack

    Exchanging data variables?

    mini = 0 maxi = 100 guess = (mini+maxi)/2 win = False print 'Please think of a number between 0 and 100!' print 'Is your secret number', guess, '?' while (win == False): choice = raw_input('Enter "h" to indicate the guess is too high. Enter "l" to indicate the guess is too low. Enter...
  10. chopnhack

    Exchanging data variables?

    Makes sense, thanks guys! I assume that you are talking about the print statement that asks if the guess is correct that appears three times. Would it be accomplished with a goto command pointing to a global print statement of "if guess is correct". Create function whose only purpose is to...
  11. chopnhack

    Exchanging data variables?

    It was much simpler gents!! What was missing was a repeat of the line prompting if the secret number was correct when an error occurred!!! Thanks everybody :D mini = 0 maxi = 100 guess = (mini+maxi)/2 win = False print 'Please think of a number between 0 and 100!' print 'Is your secret...
  12. chopnhack

    Exchanging data variables?

    Here is the error I am getting. Can anyone spot the issue?
  13. chopnhack

    Exchanging data variables?

    No worries, I fixed that part. The darn auto submission won't let me threw still! Thanks for your help, I really appreciate it!!!
  14. chopnhack

    Exchanging data variables?

    I had that and then I had the variable in parenthesis. I think its a syntax issues between versions. Its quite annoying... but since its not allowing me to submit my answer for the online automatic grader, I can't finalize that section. Let me show you what their output is: See the wording...
  15. chopnhack

    Exchanging data variables?

    I had thought of it but put it aside thinking it would compound my problems as it would require all to be not true inclusive. I will go and test it anyways, right now! Edit: It works!!! so it forces the argument to search if any input is != l, c, h inclusively. I thought that or would do...
  16. chopnhack

    Exchanging data variables?

    I don't think this is an Else If situation as it needs to be if input is not either h,l or c - prompt error, rekey. But when I put this into my loop, no matter where I put it in the order of the loop I get strange results. Even though I am using or, it will typically print out at the end, two...
  17. chopnhack

    Exchanging data variables?

    I think I see it!!!! mini = 0 maxi = 100 guess = (mini+maxi)/2 win = False print 'Please think of a number between 0 and 100!' print 'Is your secret number %d?' , guess while (win == False): choice = raw_input('Enter "h" to indicate the guess is too high. Enter "l" to...
  18. chopnhack

    Exchanging data variables?

    Fresh eyes - You are saying that when guess is too low, I should rebind (Max-Min)/2 (which is 50) to Min creating the next of 100+50/2 = 75 - which is what I thought I did above with guess=guess+hi/2 - but I need to swap out one of the guess variable for another variable so the value can pass...
  19. chopnhack

    Exchanging data variables?

    Laplace, I thought I understood where you were going with this, it seemed familiar - is it the Newton - Raphson approach? I haven't learned that well yet. I tried to construct code using your variables, but I didnt understand the argument "guess=(min+max)/2=N" - Can you double assign like this...
  20. chopnhack

    Exchanging data variables?

    No, you probably have laid it out pretty clearly... I think my brain stopped processing a few hours ago..the body is too stupid to realize it and thinks it can continue - I will sleep on it, its been >18 hours since my last recharge anyway :p Thanks Gryd3
Top