[Tutor] this is hard
Danny Yoo
dyoo@hkn.eecs.berkeley.edu
Mon, 19 Aug 2002 12:55:24 -0700 (PDT)
On Mon, 19 Aug 2002, melvin terry wrote:
> why wont this work? When you type 1 noting happenes
>
> #welcome
> print "welcome ryan I just wanted you to have a second calculator!"
> print "here you can ahose from what you would like o ind the rarea of..."
> input = raw_input("type 1 for a rectangle")
> if input == 1:
> heigth = input("please type height here:")
> width = input ("please type width here:")
> area = height*width
> print "The area is", area
Hi Melvin,
Can you explain why the program uses raw_input() here:
> input = raw_input("type 1 for a rectangle")
while, later on in the program, it uses the input() function? There's a
difference between the two functions that's causing the bug in the
program.
Best of wishes!