Just a little Coding

  

June 7th: Coding (just a little)

June 7, 2024

Today, the STEM skills class started to "dabble" into coding using the Python coding language. Although some people may have more experience than others, there were many different opportunities and coding projects that we (as students) could access. 
 


I have learned code and algorithms previously, so I decided to go with the group that knew how to code (a bit). I downloaded Anaconda and began to code. For my coding problem, I decided to do a "guess your number algorithm". The user inputs a number between -50 and 50 and the computer returns three prompts: (1) the player guessed too high, (2) the player guessed too low, or (3) the player guessed correctly. Only #3 will end the game. 

For this algorithm, I was given a template.


To create such a program, I filled out the if and elif statements with inequalities that were lower and higher than "correct_num" so that a print statement would tell the user if their guess was above or below the guess. The code took some time to think through, but successfully works as the program. My finished program is below. 



This was a good challenge for my coding skills and I enjoyed it a lot. Here are some links for the Anaconda installation and Python.



Comments

Popular posts from this blog

About me and my blog

Op-Ed: Digital Divide

The Self Driving Trolley Problem