Teach me python, I'll teach you chess

Sort:
MontecristoA

Hello, any python programmers here who would like some chess lessons?

I would love to learn the language, currently enrolled in some courses, but I would like to make it more interactive.

When I was starting out in chess, there were courses as well, but having a coach really made the process easier and more enjoyable. I am hoping the same is true for python.

In exchange for your programming tutoring, I would be able to help you with your chess. I am a candidate master with teaching experience (25+ students overall), will be able to address issues you face in the game and help you improve.

llama47

I'm not offering to teach python, but I'm just curious, do you know any programming languages or would this be your first?

MontecristoA
llama47 wrote:

I'm not offering to teach python, but I'm just curious, do you know any programming languages or would this be your first?

This would be my first. What is the purpose of the question?

llama47

Once you learn one it's easier to learn others, because the process / thinking is basically the same.

One reason the answer helps is, like chess, there are all sorts of skill levels. Some people program casually while others have spent 5, 10, or 20 years in a professional setting. So just like with chess, knowing your level will let people know whether they can be useful to you.

DefenderPug2

Something you can do to figure out how complex or hard it will be to learn a coding language is by doing the “Hello.World” test. In HTML.

To say hello.world you say:

<p>hello.world

and to go to a new line or break off of one you would say:

<br>

for python. 
print(“hello.world”)

and to go to a new line and write more stuff you would add “\n”

print(“hello.world\nHi”)

the output would be 

hello.world

Hi

python and html are good starters. But to get into the feel of code, you could use block code, like Scratch.

DefenderPug2

Although I’m still learning python myself. So I won’t be able to teach you much.

MontecristoA

@llama47 thank you for you comment. True, I remember reading that knowing one language, makes learning others easier, as you already have the understanding of algorithmic thinking and syntax. 

MontecristoA

@defenderpug2 thank you for the tip. I already know how to print and other basic functions. Trying to take it to the next level. So like in chess when you know how to move the pieces, but then you want to learn how to actually play

MontecristoA

R-rishi I know the basics of syntax, that's all, goal is to create something along my interests. Put the knowledge to practice.

If you are a programmer, any tip/advice is welcome

MontecristoA
Aswin_Senpai wrote:

Sorry I known c++ and c

Do you use them for work or know them just for fun? I am more curious about python as I read it's a beginner friendly language

Kestony

There are a lot of very decent tutorials online made by professional teachers on the python language. I was learning from this guy: https://youtu.be/8DvywoWv6fI

GeorgeWyhv14

Start small, gradually go bigger. This is what I suggest.

https://www.w3schools.com/python/python_classes.asp

HerriotJa

I am still learning and would not be a help.

Anonymous_Dragon
DefenderPug2 wrote:

Although I’m still learning python myself. So I won’t be able to teach you much.

Same

Thee_Ghostess_Lola

use sublime azza text builder. its free, it indents, & it colors ur code.

ur welcome...in advance. 

decipher2k20

For testing your code, check out https://jupyter.org/ - it allows you to wirte down a few lines of code, then  you hit the play  button, and then it shows the output. great for learning how things work.

Even though I'm primarily a C#/Java developer, I've got some experience with Python. So i could teach you the basics of coding with it.

MontecristoA

Thank you all for the tips! I really appreciate it happy.png

Thee_Ghostess_Lola

i hope u pick up a few things from this happy.png !

i put this together to find ur 5 white ball numbers in megamillions. if u run it itll tell u how many tries it took & how long (to the 1/10th of a sec (hence the :4 in there). for x & y object lists u can plug in any 5 #s ur cockled little <3 so desires lol ! i chose the top & bottom 5 (playing a funzie $4). its on V3.6 & ur gonna hafta dnload the random & time modules.

see the #71 in the loop range ? remember ur top end search goes up to 70 (and then add +1) cuz theres 70 balls in megamillions (just re: up to but not including). also i gave it a arb loop count of 1BB but itll hit WAY before then.

ok. so i just ran it & it found the 'y' object after 2,391,019 tries in 10.1 seconds happy.png .

the return looked like this:

[66, 67, 68, 69, 70]

yay !...found y in 2391019 tries

10.1 seconds

(the odds are abt 11 million to 1 as 70!/(65!*5!)=~11MM. but im tryn to hit two lists so halfa that...or 5.5 million to 1. and the abv took abt 2.4 million tries so not bad !)

****

import random
import time

x = [1,2,3,4,5]
y = [66,67,68,69,70]

def goget( ):
    for i in range (1000000000):
        numbers = random.sample(range(1,71,1),5)
        numbers.sort( )
        if numbers == x:
            print(numbers)
            print(f'yay !...found x in {i} tries')
            break
        if numbers == y:
            print(numbers)
            print(f'yay !...found y in {i} tries')
            break

start = time.time( )

goget( )

spread = time.time( ) - start

print (str(spread)[:4] + f' seconds')

****

now mister op...lol !...try2finish the code by adding the search for the gold ball (1 to 25)...gl !

hint: u wont needta redefine a/t. just add some code to the goget function.

Thee_Ghostess_Lola

ok. just tried it again & got this return:

[1, 2, 3, 4, 5]

yay !...found x in 11406282 tries

52.5 seconds (my computers pokey)

so 11.4 million loops which is abt dbl a what it shooda took w/ (2) picks. owell.

ok. im done now. now...lets see if u can code it for the gold ball inclusive...yee ! if not ill show u later happy.png .

removedusername8329742834

As others, already mentioned,  but here is the webiste not only the youtube video:

https://www.py4e.com

 

I did the course and via, freecodecamp and it was a good one. But without practice you will forget the things.