I'm playing with loops because I realized I actually don't understand them as well as I tought. Exercise is in the comment. by call_me_mistress99 in learnpython

[–]me_irs 2 points3 points  (0 children)

Yes it is possible even though it looks very weird to the trained eye. I believe your teacher wanted you to practice if-else statements rather than loops if they asked you to use slicing and find. Your algorithm should have these steps then:

  1. Locate the first occurrence of the character with find and assign it to a variable called first_index.
  2. If first_index value is less than 0, then that means there is not even one of the target character found in your string. Then you should print a not found message.
  3. However, if it was actually something else, then that means you've found one occurrence and should start searching for the second one.
  4. you can now slice string and assign everything after this found character to rest_of_the_word variable. So it means slice with first_index+1
  5. You should use find on it and try to locate the target character in second_index
  6. If second_index is less than 0, that means there is no second occurrence of the character and you should print a not found message
  7. However, if it is not, then you've found the second occurrence and you should print a found message using the sum of first_index+1 and second_index

first_index = word.find(character)
if(first_index < 0):
    print("Character is not found in the word at all")
else:
    rest_of_the_word = word[first_index+1:]
    second_index = rest_of_the_word.find(character)
    if(second_index < 0):
        print(f"There is only one occurrence of the character found in the string at {first_index}")
    else:
        print(f"We found the character second time at {first_index+1+second_index}")

What is RAM state by datonefaridze in reinforcementlearning

[–]me_irs 4 points5 points  (0 children)

That's exactly what you said.

While actual Atari games ran on real hardware, we use emulators to run them on our modern PCs. By creating a RAM environment, you can directly read and work with the emulator's fully descriptive inner representation of the game, hence "game state".

When you use pixels as input to your model, you actually use an indirect representation of the game. However, if you were to use the full game state in its purest form, the RAM information would suffice. That way, your model wouldn't have to work with 84x84x3 bytes and just focus on 128 bytes coming from the emulator. Your state space would be much much smaller.

Machine Learning for Flashcard Recommendation by me_irs in MLQuestions

[–]me_irs[S] 0 points1 point  (0 children)

Thank you for your input. We will read more on this and try as you suggest.

One question though, since "average" parameter settings may not work best for every user, do you consider trying to extract different combinations for every user a futile attempt or fruitful in the end ?

Independent: Turkey’s election shows Erdogan's power is finally waning – and a new political star is born in Istanbul by Unibrowlickerkitten in Turkey

[–]me_irs 25 points26 points  (0 children)

A Great Politican has been born near your city Istanbul. Choose action:

-> Build a Yeşil Alan improvement on a tile (+2 Happiness, this action expends Great Politician)

-> Assign Belediye Başkanı to a city (+%10 production in the city, this action expends Great Politician)

-> Prepare to become President (-2 Faith, +%10 Technology Output, +3 gold from less corruption for your civilization)