Author Topic: What is wrong with this code!?  (Read 1290 times)

0 Members and 1 Guest are viewing this topic.

Offline dillond21

  • Serf
  • *
  • Posts: 30
  • Cookies: -5
    • View Profile
What is wrong with this code!?
« on: July 20, 2012, 03:54:42 pm »
Okay so I have been coding in Python and i was just trying to make a simple program but for some reason i can't figure it out! Any help would be awesome.
Here it is:

Code: (python) [Select]
print ('Hello!')
print ('What is your name?')
myName= input()
print ('Nice to meet you ' +  myName)
print ( 'What do you like to do')
myHobbies=input()
if myHobbies=('nothing'):
    print("Oh, that's too bad")
print ('Oh I LOVE too' + myHobbies)
print('Have you ever tried bowling professionally?')
myBowl=input()
print("Don't lie!!!")
mylie=input()
print('Okay I believe you, but i have to go!')
print (' Bye!')
end=input()

If you noticed i tried to add in a little area where someones answer might be no, or nothing but i don't really know how, this was just a guess. Anyway the program won't run, so what should i do?

« Last Edit: July 20, 2012, 06:15:42 pm by Kulverstukas »

Offline iTpHo3NiX

  • EZ's Pirate Captain
  • Administrator
  • Titan
  • *
  • Posts: 2920
  • Cookies: 328
    • View Profile
    • EvilZone
Re: What is wrong with this code!?
« Reply #1 on: July 20, 2012, 06:14:03 pm »
asdf
« Last Edit: February 13, 2013, 11:54:44 am by DeepCopy »
[09:27] (+lenoch) iTpHo3NiX can even manipulate me to suck dick
[09:27] (+lenoch) oh no that's voluntary
[09:27] (+lenoch) sorry

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: What is wrong with this code!?
« Reply #2 on: July 20, 2012, 06:18:01 pm »
Moved to Scripting languages board and edited your post.
Code seems inconsistent, and 9th line should be in the "else" part of the "if". Also use "raw_input".

Offline dillond21

  • Serf
  • *
  • Posts: 30
  • Cookies: -5
    • View Profile
Re: What is wrong with this code!?
« Reply #3 on: July 20, 2012, 07:40:25 pm »
Use raw_input for the entire thing?
And substitute else for if?

« Last Edit: July 21, 2012, 01:35:08 am by dillond21 »

Offline iTpHo3NiX

  • EZ's Pirate Captain
  • Administrator
  • Titan
  • *
  • Posts: 2920
  • Cookies: 328
    • View Profile
    • EvilZone
Re: What is wrong with this code!?
« Reply #4 on: July 20, 2012, 08:28:20 pm »
asdf
« Last Edit: February 13, 2013, 11:54:34 am by DeepCopy »
[09:27] (+lenoch) iTpHo3NiX can even manipulate me to suck dick
[09:27] (+lenoch) oh no that's voluntary
[09:27] (+lenoch) sorry

Offline dillond21

  • Serf
  • *
  • Posts: 30
  • Cookies: -5
    • View Profile
Re: What is wrong with this code!?
« Reply #5 on: July 21, 2012, 01:34:24 am »
Thanks! And haha i won't double post! Hahaha, I'm just trying to get on your level ;)