January 19, 2025, 03:09:36 PM

1,531,386 Posts in 46,736 Topics by 1,523 Members
› View the most recent posts on the forum.


WHAT PROGRAMMING LANGUAGES DO YOU KNOW OR WANT TO LEARN

Started by ncba93ivyase, December 26, 2008, 08:21:47 PM

previous topic - next topic

0 Members and 3 Guests are viewing this topic.

Go Down

superclucky

Quote from: Frutta Procione on December 26, 2008, 08:47:52 PM
CSS ISN'T A LANGUAGE WOMAN.



All of them are weird looking though.

Also makes clickies.  cjlubdoods;
kewns are smelly

Dullahan

Quote from: Det's Placenta on December 26, 2008, 08:49:41 PM
All of them are weird looking though.

Also makes clickies.  cjlubdoods;
You make clickies. cjlubdoods;

CHAOS66


Daddy

Quote from: Det's Placenta on December 26, 2008, 08:49:41 PM
All of them are weird looking though.

Also makes clickies.  cjlubdoods;
Learn Haskell cjlubdoods;

superclucky

kewns are smelly

Daddy



ncba93ivyase

Code Select
#OH FUCK I CAN CALCULATE SHIT

loop = 1

choice = 0

while loop == 1:
   print "LMAO Welcome to JMV's Calculator\n\n \n Nigga, pick an option:\n\n\n 1) Add Shit\n 2) Subtract Shit\n 3) Multiply Shit\n 4) Divide Shit\n 5) Quit\n\n"
   
   choice = input("Pick one, faggot:")

   if choice == 1:
       a1 = input("First Number: ")
       a2 = input("Second Number: ")
       print a1, "+", a2, "=", a1 + a2
   elif choice == 2:
       s2 = input("First Number: ")
       s1 = input("Second Number: ")
       print s1, "-", s2, "=", s1 - s2
   elif choice == 3:
       m1 = input("First Number: ")
       m2 = input("Second Number: ")
       print m1, "*", m2, "=", m1 * m2
   elif choice == 4:
       d1 = input("First Number: ")
       d2 = input("Second Number: ")
       print d1, "/", d2, "=", d1 / d2
   elif choice == 5:
       loop = 0
print "LOL THANKS"
there's one way to slim down your code

alternatively you could've put that huge chunk of text in the beginning inside triple quotes

Quote from: ncba93ivyase on June 18, 2014, 07:58:34 PMthis isa great post i will use it in my sig

guff

brainfuck takes all of five seconds to learn  akudood;
the issue is actually figuring out how to do anything with it

but uh i know python and ruby, and i'm learning j and haskell for kicks
j is crazy fun  baddood;

also jimmy i told you a while ago to use raw_input  madood;

ncba93ivyase

Quote from: Commodore Guff on December 26, 2008, 09:00:37 PM
brainfuck takes all of five seconds to learn  akudood;
the issue is actually figuring out how to do anything with it

but uh i know python and ruby, and i'm learning j and haskell for kicks
j is crazy fun  baddood;

also jimmy i told you a while ago to use raw_input  madood;
raw_input should be used mainly for strings and input for integers

so why should he use raw_input instead because if he's looking solely for numbers then it'll raise an error automagically if someone decides to be a smartass and enter 'q'

Quote from: ncba93ivyase on June 18, 2014, 07:58:34 PMthis isa great post i will use it in my sig

ncba93ivyase

also, even better implementation of jimmy's project
Code Select
class Goats():
def __init__(self):
self.a = input("Enter first number: ")
self.b = input("Enter second number: ")
if choice == 1:
self.adder()
if choice == 2:
self.subtracter()
def adder(self):
print "A+B =", self.a+self.b
def subtracter(self):
print "A-B =", self.a-self.b

print "1: Add \n2: Subtract"
choice = input("Which one?")
Goats()

Didn't include all the options but enough to show how true men do it

Quote from: ncba93ivyase on June 18, 2014, 07:58:34 PMthis isa great post i will use it in my sig

guff

Quote from: Lawlz on December 26, 2008, 09:04:06 PM
raw_input should be used mainly for strings and input for integers

so why should he use raw_input instead because if he's looking solely for numbers then it'll raise an error automagically if someone decides to be a smartass and enter 'q'
uh no, raw_input should be used for everything which is why they got rid of input in python3.0 and replaced it with raw_input akudood;

because raw_input doesn't parse anything which means it's not going to do anything unexpected (input evaluates expressions which is an awfully silly functionality for a menu)
the same functionality can be achieved by doing something like choice = int(raw_input("Pick one, faggot: ")) instead and it would still raise an error if said smartass enters 'q'  madood;

basically it's just good practice to use raw_input instead and if you really, really need input (WHICH YOU NEVER WILL >:O) it's better to use eval(raw_input()) with some safeguards instead  bassir;

ncba93ivyase

Quote from: Commodore Guff on December 26, 2008, 09:16:11 PM
uh no, raw_input should be used for everything which is why they got rid of input in python3.0 and replaced it with raw_input akudood;

because raw_input doesn't parse anything which means it's not going to do anything unexpected (input evaluates expressions which is an awfully silly functionality for a menu)
the same functionality can be achieved by doing something like choice = int(raw_input("Pick one, faggot: ")) instead and it would still raise an error if said smartass enters 'q'  madood;

basically it's just good practice to use raw_input instead and if you really, really need input (WHICH YOU NEVER WILL >:O) it's better to use eval(raw_input()) with some safeguards instead  bassir;
python 3.0 hates pygame and killed the print command and put the print function on his throne :'(

So I don't like it much yet.

Quote from: ncba93ivyase on June 18, 2014, 07:58:34 PMthis isa great post i will use it in my sig

guff

Quote from: Lawlz on December 26, 2008, 09:19:01 PM
python 3.0 hates pygame and killed the print command and put the print function on his throne :'(

So I don't like it much yet.
uh print as a statement was awfully silly and at least with the function you can easily change the separator and end-of-line behavior (versus doing things like "print foo," to suppress the line break)

i love it simply for it not differentiating between ints and longs anymore but there's other stuff too  akudood;

ncba93ivyase

Quote from: Commodore Guff on December 26, 2008, 09:22:27 PM
uh print as a statement was awfully silly and at least with the function you can easily change the separator and end-of-line behavior (versus doing things like "print foo," to suppress the line break)

i love it simply for it not differentiating between ints and longs anymore but there's other stuff too  akudood;
but just saying print 'hello world' was what made python look so simple and appealing and beautiful to the world of retards like jmv and it's sad to see him die :'(

Quote from: ncba93ivyase on June 18, 2014, 07:58:34 PMthis isa great post i will use it in my sig

Go Up