Hacking Demo: https://www.youtube.com/watch?v=JTbqvgED_y0
New Updated Code Here: (WITH JAVA COMPARISON) MUCH WATCH!
https://www.youtube.com/watch?v=g70WJVsTyQE
Want to support my channel?
https://www.patreon.com/codecommand
I’ll be eternally grateful
In this video I go through the basics of Python by showing you how to create a simple guess the number game.
Creating this game with a GUI: https://www.youtube.com/watch?v=sx0aUvHz3cI
Please subscribe & like for more content, tutorials and tips!
**********************************
Download Python: https://goo.gl/YkZpjQ
Download Pycharm: https://goo.gl/zpcXQd
CODE FOR THE GAME HERE (updated 2018):
https://goo.gl/vMtAVK
***********************************
Connect With Me:
Twitter: https://goo.gl/HssDVu
Website: www.codeoncommand.com
***********************************
Amazon Auto Links: No products found.
new link with much better code: https://goo.gl/vMtAVK
there is no end to your game. when you run it in the python shell it just quits after you guess the number correctly. Roblox guy in your comments had a finish for it
can u creating a trivia game?
How did you learn to do this?
That’s a nice way of teaching the classic binary search algorithm props to you 😉
I know SQL and not sure what’s next but you made it look like feasible. Awesome video!
That was much more helpful thanks alot! Now I can begin creating my own game!
Oh like and share every one please i want 1000 subscribe
what’s fuck
His voice is so damn pleasant.
what version is this?
bro there are two versions of pycharm
which one should i download pls
the random module isnt callable help plz
That didn’t work… but this did
import random
attempts = 1
secret_number = random.randint(1,100)
isCorrect = False
guess = int(input(“Take a guess: “))
while secret_number != guess and attempts < 6: if guess < secret_number: print("Higher...") elif guess > secret_number:
print(“Lower…”)
guess = int(input(“Take a guess: “))
attempts += 1
if attempts == 6:
print(“nSorry you reached the maximum number of tries”)
print(“The secret number was “,secret_number)
else:
print(“nYou guessed it! The number was ” ,secret_number)
print(“You guessed it in “, attempts,”attempts”)
input(“nn Press the enter key to exit”)
Why repeat yourself with the if statements, its better to have them all inside the loop
CAN YOU DONA TIC TAC TOE GAME?
“NameError: name ‘guess’ is not defined” any ideas on how to fix this?
i copied this for my homework
Why do you sound nervous?
R.I.P Headphone users, and maybe his mic
I’m new to open-source languages. What IDE can you recommend?
You sound like Maurice from IT Crowd.
what script do you use for running it on atom? like I tried a lot of them and none worked for me
Rest in piece Snowball we’ll all miss you , for real tho nice tutorial enjoyed it a lot , it was fun coding a long with you since its my 1st time doing so in python , had me dying when you dropped the mic tho 😀
is this guy from Liverpool?/ are you from liverpool mate?
Bcuze your accent is scouse!
Its not letting me run the code on pycharm. Everytime i click run, it gives me an option to edit configuration. Would appreciate some help. Newbie here. Thanks.
2018 but this is better:
print(“Hi, what is your name?”)
name = input(“>>”)
print(“Hello ” + name + “!”)
Good example
Cool… it worked..my first Python program 🙂 Cheers CodeCommand!.
What editor is this??
What is the for in the last line of code.
Why can’t I run the code on python 3.6.4? Im getting syntax errors, shitload of indentation errors and the inputs are not working properly, same thing happens if I make my own code or copy any of yours.
Edit: It actually works in pycharm, but why can’t I copy it straight into python?
are you a scouser?
This wasn’t helpful at all, I’m disappointed, This was supposed to be a tutorial.
hahahaha!!moi aussi c quand y a dropper le mic Loll
Wow… I’m a very beginner and i would like to see more of your videos 🙂
On your line 22 guess is highlighted. When I put in the same code when it reaches there it gives me an error and it says that guess is not defined. Help please????
I think, gamemaker is much better
import random
number = random.randint(1, 10)
tries = 1
win = False # setting a win flag to false
name = input(“Hello, What is your usernmae?”)
print(“Hello”, name + “.”, )
question = input(“Would you like to play a game? [Y/N] “)
if question == “N”:
print(“oh..okay”)
if question == “Y”:
print(“I’m thinking of a number between 1 & 10 “)
while not win: #while the win is not true, run the while loop. we set win to false at the start therefore this will always run.
guess = int(input(“Have a guess: “))
tries = (tries)+1
if guess == number:
win = True # set win to true when the user guesses correctly.
elif guess < number: print("Guess Higher") elif guess > number:
print(“Guess Lower”)
if win: # if win is true then output message
print(“Congrats, you guessed correctly. The number was indeed {}”.format(number))
print(“It took you {} tries”.format(tries-1))
how about this?
https://www.fiverr.com/nomiali007
i thought you gonna show us how to make next assassins creed…but this is cool too
This is awesome! Thanks so much man! Keep up the videos!
Dude I actually love how the video flowed, seeing you fix mistakes most people might casually make really helps understand the tediousness of code even when really simple. Thanks for the video man great job I was laughing my ass off at the if < if > part.
see this sequence..do you think is it correct to ask for a guess if a user has selected ‘n’ at the start? Just a gentle query 🙂
Hello, What is your username?bunty
Hello bunty.
Would you like to play a game? [Y/N] n
oh..okay
Have a guess: 4
Guess Lower
Have a guess: 3
Guess Lower
Have a guess: 2
Congrats, you guessed correctly. The number was indeed 2
it had taken you 4 tries