Computer experts needed! Python programing?
Computer experts needed! Python programing?
Hi guys. Need a little help with this.
I m trying to write out a very simple game by using python script.
______________________________________________
Mac people: go to http://www.python.org/download/mac/ for some basic information, and to http://www.python.org/download/releases/á to download it.
Windows People: you can go to http://www.portablepython.com/ for basic information about Portable Python.á Go to http://www.portablepython.com/wiki/P...thon1.1Py3.0.1 to download it.á I would recommend the http link for USA.á You will download one .exe file, which you should put on a flash drive.á When you run it, it won't install anything, but create a folder with two .exe files and another file in it.á That's it! You don't have to do anything else.
______________________________________________
Information above is where i got the python from. (which is what the professor gave it to us.).
This thing is just totally new to me, but the professor teaches us as if we have knowledge about it. lol. It's a GE requirement class for me, Computer Science. (I'm a business major).
Anyway, if anyone knows about it, here's what i have now.
________________________
import random
guesses = 0
ran = random.randint (1,50)
yourname = input('what is your name?:')
print('hi')
print('well, i am thinking of a number between 1 and 20')
print('you have 10 guesses to figure it out')
while guesses <10:
yourguest = int(input('what is your guess?'))
if yourguest == ran:
print('you are right, congratulation !!!')
break;
elif yourguest > ran:
print('your guess is too high')
elif yourguest < ran:
print('your guess is too low')
guesses = guesses + 1
print('you are wrong, please try again!')
print('you have ' + str(10-guesses) + ' left')
if guesses ==6:
print('you lost!!!')
print ('done')
_________________________
It's a small guessing game. I just want to add something on it, but i can't seem to come up with the right thing. !!
Two things i want to add on it.
- After typing in the name when the game prompts to, instead of saying just HI, i want it to say ( HI "the name entered".. )
- Also, I want to end the game and then have a line to ask " Do you want to try again? YES OR NO.
If Yes, the whole thing go over again, while if No is entered, it ends the game with THANKS FOR PLAYING.
Ideas?? Thankss!!
I m trying to write out a very simple game by using python script.
______________________________________________
Mac people: go to http://www.python.org/download/mac/ for some basic information, and to http://www.python.org/download/releases/á to download it.
Windows People: you can go to http://www.portablepython.com/ for basic information about Portable Python.á Go to http://www.portablepython.com/wiki/P...thon1.1Py3.0.1 to download it.á I would recommend the http link for USA.á You will download one .exe file, which you should put on a flash drive.á When you run it, it won't install anything, but create a folder with two .exe files and another file in it.á That's it! You don't have to do anything else.
______________________________________________
Information above is where i got the python from. (which is what the professor gave it to us.).
This thing is just totally new to me, but the professor teaches us as if we have knowledge about it. lol. It's a GE requirement class for me, Computer Science. (I'm a business major).
Anyway, if anyone knows about it, here's what i have now.
________________________
import random
guesses = 0
ran = random.randint (1,50)
yourname = input('what is your name?:')
print('hi')
print('well, i am thinking of a number between 1 and 20')
print('you have 10 guesses to figure it out')
while guesses <10:
yourguest = int(input('what is your guess?'))
if yourguest == ran:
print('you are right, congratulation !!!')
break;
elif yourguest > ran:
print('your guess is too high')
elif yourguest < ran:
print('your guess is too low')
guesses = guesses + 1
print('you are wrong, please try again!')
print('you have ' + str(10-guesses) + ' left')
if guesses ==6:
print('you lost!!!')
print ('done')
_________________________
It's a small guessing game. I just want to add something on it, but i can't seem to come up with the right thing. !!

Two things i want to add on it.
- After typing in the name when the game prompts to, instead of saying just HI, i want it to say ( HI "the name entered".. )
- Also, I want to end the game and then have a line to ask " Do you want to try again? YES OR NO.
If Yes, the whole thing go over again, while if No is entered, it ends the game with THANKS FOR PLAYING.
Ideas?? Thankss!!
I think you should be good with this. Don't know why it doesn't show the indent in here. Added pic for you. Good luck with the class. CS was hard when I first started too 
================================================== ==============
import random
guesses = 0
ran = random.randint (1,20)
cond = True
yourname = input('What is your name?:')
print('Hi' + ' ' + yourname)
print('Well, I am thinking of a number between 1 and 20.')
print('You have 10 guesses to figure it out.')
while cond == True:
while guesses < 10:
yourguest = int(input('What is your guess?'))
if yourguest == ran:
print('You are right. Congratulations!!!')
cond = False
break
elif yourguest > ran:
print('Your guess is too high!')
elif yourguest < ran:
print('Your guess is too low! Please try again!')
guesses = guesses + 1
print('You have ' + str(10-guesses) + ' left.')
if guesses == 10:
print('You lost!!!')
tryAgain = input('Would you like to try again?')
if tryAgain == "no":
print('Thanks for playing!!!')
cond = False
if tryAgain == "No":
print('Thanks for playing!!!')
cond = False
guesses = 0
================================================== ==============
import random
guesses = 0
ran = random.randint (1,20)
cond = True
yourname = input('What is your name?:')
print('Hi' + ' ' + yourname)
print('Well, I am thinking of a number between 1 and 20.')
print('You have 10 guesses to figure it out.')
while cond == True:
while guesses < 10:
yourguest = int(input('What is your guess?'))
if yourguest == ran:
print('You are right. Congratulations!!!')
cond = False
break
elif yourguest > ran:
print('Your guess is too high!')
elif yourguest < ran:
print('Your guess is too low! Please try again!')
guesses = guesses + 1
print('You have ' + str(10-guesses) + ' left.')
if guesses == 10:
print('You lost!!!')
tryAgain = input('Would you like to try again?')
if tryAgain == "no":
print('Thanks for playing!!!')
cond = False
if tryAgain == "No":
print('Thanks for playing!!!')
cond = False
guesses = 0
Last edited by mdkxtreme; Aug 13, 2010 at 11:33 PM.
Use the code tag:
Code:
import random
guesses = 0
ran = random.randint (1,20)
cond = True
yourname = input('What is your name?:')
print('Hi' + ' ' + yourname)
print('Well, I am thinking of a number between 1 and 20.')
print('You have 10 guesses to figure it out.')
while cond == True:
while guesses < 10:
yourguest = int(input('What is your guess?'))
if yourguest == ran:
print('You are right. Congratulations!!!')
cond = False
break
elif yourguest > ran:
print('Your guess is too high!')
elif yourguest < ran:
print('Your guess is too low! Please try again!')
guesses = guesses + 1
print('You have ' + str(10-guesses) + ' left.')
if guesses == 10:
print('You lost!!!')
tryAgain = input('Would you like to try again?')
if tryAgain == "no":
print('Thanks for playing!!!')
cond = False
if tryAgain == "No":
print('Thanks for playing!!!')
cond = False
guesses = 0
Use the code tag:
Code:
import random
guesses = 0
ran = random.randint (1,20)
cond = True
yourname = input('What is your name?:')
print('Hi' + ' ' + yourname)
print('Well, I am thinking of a number between 1 and 20.')
print('You have 10 guesses to figure it out.')
while cond == True:
while guesses < 10:
yourguest = int(input('What is your guess?'))
if yourguest == ran:
print('You are right. Congratulations!!!')
cond = False
break
elif yourguest > ran:
print('Your guess is too high!')
elif yourguest < ran:
print('Your guess is too low! Please try again!')
guesses = guesses + 1
print('You have ' + str(10-guesses) + ' left.')
if guesses == 10:
print('You lost!!!')
tryAgain = input('Would you like to try again?')
if tryAgain == "no":
print('Thanks for playing!!!')
cond = False
if tryAgain == "No":
print('Thanks for playing!!!')
cond = False
guesses = 0
I think you should be good with this. Don't know why it doesn't show the indent in here. Added pic for you. Good luck with the class. CS was hard when I first started too 
================================================== ==============
import random
guesses = 0
ran = random.randint (1,20)
cond = True
yourname = input('What is your name?:')
print('Hi' + ' ' + yourname)
print('Well, I am thinking of a number between 1 and 20.')
print('You have 10 guesses to figure it out.')
while cond == True:
while guesses < 10:
yourguest = int(input('What is your guess?'))
if yourguest == ran:
print('You are right. Congratulations!!!')
cond = False
break
elif yourguest > ran:
print('Your guess is too high!')
elif yourguest < ran:
print('Your guess is too low! Please try again!')
guesses = guesses + 1
print('You have ' + str(10-guesses) + ' left.')
if guesses == 10:
print('You lost!!!')
tryAgain = input('Would you like to try again?')
if tryAgain == "no":
print('Thanks for playing!!!')
cond = False
if tryAgain == "No":
print('Thanks for playing!!!')
cond = False
guesses = 0

================================================== ==============
import random
guesses = 0
ran = random.randint (1,20)
cond = True
yourname = input('What is your name?:')
print('Hi' + ' ' + yourname)
print('Well, I am thinking of a number between 1 and 20.')
print('You have 10 guesses to figure it out.')
while cond == True:
while guesses < 10:
yourguest = int(input('What is your guess?'))
if yourguest == ran:
print('You are right. Congratulations!!!')
cond = False
break
elif yourguest > ran:
print('Your guess is too high!')
elif yourguest < ran:
print('Your guess is too low! Please try again!')
guesses = guesses + 1
print('You have ' + str(10-guesses) + ' left.')
if guesses == 10:
print('You lost!!!')
tryAgain = input('Would you like to try again?')
if tryAgain == "no":
print('Thanks for playing!!!')
cond = False
if tryAgain == "No":
print('Thanks for playing!!!')
cond = False
guesses = 0

Trending Topics
There's a lot of interactive code courses online. But this was the one that I used to learn Javascript and a bit of Python: http://www.codecademy.com/en/tracks/python
Thanks guys.
Downloaded python 3.4.1 and IDLE, been playing with it a bit
The last programming I did was loops in Basic to make my name scroll on the screen....
Downloaded python 3.4.1 and IDLE, been playing with it a bit
The last programming I did was loops in Basic to make my name scroll on the screen....
Last edited by stogie1020; Jul 2, 2014 at 11:21 AM.
Any reason you want to learn Python over something like Java?
I had to take both in college...learning Python first was supposed to make learning Java easier, but in the end it confused the hell out of us.
/still hate programming
I had to take both in college...learning Python first was supposed to make learning Java easier, but in the end it confused the hell out of us.
/still hate programming
Some colleagues were discussing using it to accomplish some tasks that they were working on and there is a small community of people developing python scripts for certain relevant purposes to my work.
Interesting. Ever worked with Ruby?
I can probably send you my programming stuff from school if you'd like...books/tutorials/software from class and anything else leftover. I have most of it saved somewhere that I'll never use again.
I can probably send you my programming stuff from school if you'd like...books/tutorials/software from class and anything else leftover. I have most of it saved somewhere that I'll never use again.
Interestingly, my university recently switched from Java to Python as their programming language choice for the Introduction to Computer Programming course. They figured Java was too confusing for people trying to dive into programming. I think it's a good decision because once you have just the core logic down (loops, conditions, data structures), everything else is just syntax.
Thread
Thread Starter
Forum
Replies
Last Post
rockyboy
2G RDX (2013-2018)
171
Aug 4, 2024 10:35 AM
Rocktman1
5G TLX Audio, Bluetooth, Electronics & Navigation
4
Sep 19, 2015 05:58 PM






I hate programming. No patience for it.

