Python Success!

Loneliness, Depression & Relationship Forum

Help Support Loneliness, Depression & Relationship Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Badjedidude

Well-known member
Joined
Dec 19, 2009
Messages
13,094
Reaction score
14
Location
Kansas
Well, I'm a bit of a computer geek and at some point in the past I managed to learn the programming language known as QBasic....and this was back in the day when QBasic was decently relevant and useable in the scope of modern computing. It still has its uses, sure....but I don't see anyone writing network managing scripts or front ends/GUIs in QBasic.

So I recently decided to learn a new programming language. It's been a while for me, and I'm rusty, so it's almost like I'm starting fresh. I do have a basic understanding of coding, though....so it's easier than starting blind. At any rate, here's a new simple program I wrote in Python. It's text only and all it does is convert centimeters to inches...but it's a start.

As a major project, I plan on writing a basic conversion application, perhaps even using graphics and such. Woot. Anyway, this counts as a success for me:


print "Enter a length in centimeters to get an equivalent length in inches."
centimeter = input("Length (cm): ")
toinches = .3937007874
print "Inches:", centimeter * toinches



----Steve
 
Code:
IF hardflag = 1 THEN
   DO
      pelvicthrust
      PRINT "BAM!"
   LOOP
ELSE
   FOR 1 TO 99999999
      meatspin
      PRINT "WHOOP!"
   LOOP
END IF

PRINT "Congratulations, btw!"
 
4j15c4.jpg
 
Reminds me of your cartoon................
 
Code:
/*so, I don't know any fancy shmancy languages like python and I'm also convinced that, deep down, every computer is a murderous, humanity hating son of a *****. But I can see you feel proud, so here's congratulations.cpp */

#include<iostream>
#include<string>
using namespace std;

const string BJD = "one awesome motha fucka";

void output_congrats();
int main()
{
      output_congrats();
      return 0;
}

void ouput_congrats()
{
      cout<<"BJD is "<<BJD<<"! Congratulations dude."<<endl;
}
 
LOL haha you guys are awesome. XD Thanks for the kind words.

C++ and any form of BASIC are always welcome in my world. :D haha

@mysis: LOL meatspin and pelvicthrust....nice XD

----Steve
 
An archist said:
Code:
/*so, I don't know any fancy shmancy languages like python and I'm also convinced that, deep down, every computer is a murderous, humanity hating son of a *****. But I can see you feel proud, so here's congratulations.cpp */

#include<iostream>
#include<string>
using namespace std;

const string BJD = "one awesome motha fucka";

void output_congrats();
int main()
{
      output_congrats();
      return 0;
}

void ouput_congrats()
{
      cout<<"BJD is "<<BJD<<"! Congratulations dude."<<endl;
}

I'm also learning C++ right now. I guess I'm supposed to know this, but because I'm not motivated enough to be more hardworking, my learning progress is slower than normal. So my question is, what's the "void" declaration for?
 
LOL in case you were wondering, Zak, NOW the thread has taken a turn for the nerdy. :p

When a scripter can't help but ask a technical question about a joke code written as a congratulation...you KNOW you've got geek! :D
 
I'm also learning C++ right now. I guess I'm supposed to know this, but because I'm not motivated enough to be more hardworking, my learning progress is slower than normal. So my question is, what's the "void" declaration for?

This is my fault that you have to ask this...I made the program a little more fancy than it needs to be. But a function is of type void when it either doesn't return any kind of value or it returns several. In my example, the function output_congrats() only outputs a message, but has doesn't return any value. You dig?

...or wait...

assert(duality_digs);
 
Crap, I really need to read my book about functions and do my homeworks. Anyway, you didn't really need to use a function, did you? You could've just put the output inside the main program.
 
duality said:
Crap, I really need to read my book about functions and do my homeworks. Anyway, you didn't really need to use a function, did you? You could've just put the output inside the main program.

Yeah, that's what I meant by it being needlessly fancy. But after a while of programming in C, the only things that are expected to be inside int main are gonna be variable declarations and function calls. But yeah....I was trying to impress you *blush* *nuzzle*
 
You sure Blowjobdude? or is it a bit too late to say that?
 
Badjedidude said:
No woman will now ever enter this thread.

When it hits assembly language they will flock in.
 
well, we might get a few chicks with dicks in here if we start posting code in FORTRANS
 
wow, you know...

I find this kind of discriminatory against women. Didn't i just express my interest to you about learning programming in MSN IM the other day?

LOL :p
 
Haha yeah, but do you REALLY find this thread interesting? Did you actually go CHECK OUT that programming stuff? ;) hehe

It's not discriminatory if it's mostly true. It is a FACT that computer coding/programming is an almost entirely male endeavor. There are chicks in da biz, sure....but not nearly as many as guys. *shrug* :p It's just a fact.
 
Badjedidude said:
Haha yeah, but do you REALLY find this thread interesting? Did you actually go CHECK OUT that programming stuff? ;) hehe

It's not discriminatory if it's mostly true. It is a FACT that computer coding/programming is an almost entirely male endeavor. There are chicks in da biz, sure....but not nearly as many as guys. *shrug* :p It's just a fact.

Unless we're talking about the Chinese.
 

Latest posts

Back
Top