Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 07-06-2012, 04:15 PM   #1
Baseband Member
 
Join Date: Jun 2012
Posts: 79
Default Python Programming

I made a small program that uses everything I know about python (which isn't a lot). Can someone take a look at it, then tell me other things I need to know, as well as links as to where I can study that specific subject?

Code:
close = 'N'
while close == 'N':
    print "Hello, World!"
    close = raw_input("Do you wish to exit? (Y) yes (N) no ")
    if close == 'Y':
        print "Goodbye!"
        break
    elif close == 'N':
        close = 'N'
    else:
        print "Invalid"
        close = 'N'
print "Now you've entered the calculator part."
fnum = input("  Please enter your first number: ")
snum = input("  Please enter your second number: ")
choice = raw_input("  Please choose what you wish to do (+) add (-) subtract (x or *) multiply (/) divide ")
if choice == '+':
    print "Your total is: ", fnum + snum , "!"

elif choice == '-':
    print "Your total is: ", fnum - snum , "!"

elif choice == '*':
    print "Your total is: ", fnum * snum , "!"

elif choice == 'x':
    print "Your total is: ", fnum * snum , "!"

elif choice == '/':
    print "Your total is: ", fnum / snum , "!"

else:
    print "Invalid!"
__________________

Scyere is offline   Reply With Quote
Old 07-06-2012, 11:35 PM   #2
BSOD
 
Join Date: Jun 2012
Posts: 51
Default

Check the website I think there are some tips/tutorials on their page
HP_on_Linux is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 06:28 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0