Hi!
I'm new to programming and I just started to learn Python. So far I've only been able to make an extremely simple calculator with Python :D. I'm wanting to learn either Java or C++ after I'm comfortable with Python.
print("Hello!")
Started by Shadow21, Jul 09 2010 02:52 PM
7 replies to this topic
#1
Posted 09 July 2010 - 02:52 PM
|
|
|
#2
Posted 09 July 2010 - 02:53 PM
#3
Posted 09 July 2010 - 03:47 PM
Root Beer == System Administrator's Beer
Download the new operating system programming kit! (some assembly required)
Download the new operating system programming kit! (some assembly required)
#4
Posted 09 July 2010 - 06:59 PM
Welcome aboard! Sounds like a good plan.
#5
Posted 20 July 2010 - 09:44 AM
Welcome.
I started with Python too!
Going to C++ or Java is great from Python, but....
You should really learn Python first.
If you are going to go to C++ or Java really learn classes!:)
I started with Python too!
Going to C++ or Java is great from Python, but....
You should really learn Python first.
If you are going to go to C++ or Java really learn classes!:)
#6
Posted 22 January 2011 - 09:30 PM
As you guys can see I'm a huge procrastinator...
I had to go back to school so I stopped learning Python but I started again yesterday and I've gotten farther than I ever have (which isn't that far). I'm trying to do the beginner projects on here as I learn.
It sadly took me around an hour to make and fix a simple number guessing game but I also did a little more than it asked for. This is what I came up with:
I'm really hoping I don't procrastinate again so I can finally get better at using Python.
I had to go back to school so I stopped learning Python but I started again yesterday and I've gotten farther than I ever have (which isn't that far). I'm trying to do the beginner projects on here as I learn.
It sadly took me around an hour to make and fix a simple number guessing game but I also did a little more than it asked for. This is what I came up with:
#!/usr/bin/python3
import random
on = "yes"
min = 1
max = 10
while on == "yes":
game = "yes"
randnum = random.randint(min, max)
while game == "yes": #Loops game until on = no
guess = int(input("Guess a number between 1 and 10: "))
if guess == randnum:
print("You won!")
on = str(input("Play again? (yes/no): "))
while on != "yes" and on != "no": #yes/no restriction
on = str(input("Play again? (yes/no): "))
game = "no"
elif guess < randnum:
if guess >= randnum-2:
print("A little higher!")
else:
print("Higher")
elif guess > randnum:
if guess <= randnum+2:
print("A little lower!")
else:
print("Lower")
I'm really hoping I don't procrastinate again so I can finally get better at using Python.
#7
Posted 23 January 2011 - 09:11 PM
Welcome back Shadow21, your script looks pretty well defined, good job.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#8
Posted 23 January 2011 - 09:57 PM
Alexander said:
Welcome back Shadow21, your script looks pretty well defined, good job.
Thanks and I'm glad my script looks fine. :)
I've gotten farther than I ever have with Python so I'm sure I'll stick with it. I'll probably start on a sentence generator script in a day or two.


Sign In
Create Account


Back to top









