#python

1 messages · Page 1 of 1 (latest)

celest vine
#

Write a Python program that takes 2 integer inputs from the user: the length and the width of a rectangle, calculates the area of the rectangle, and displays it.

subtle wren
#

What's your question?

#

What confuses you or don't understand from this?

#

Have you tried doing it yourself first?

celest vine
#

sorry for the late reply

#

this is what i have

#

having issue displaying the area

#

I used the same syntax the professor used

subtle wren
#

No you didn't, checkout your print

#

= servers only to assign a value to a variable. So when you do print = you're trying to assign a value to print. You're not calling the print function. To call it, you need to do print(...)

celest vine
#

ohhh

#

silly mistake

subtle wren
#

As for what's inside, there's also an error. You're doing "width, '+', length, '=', area). The first " shouldn't be there

celest vine
#

yesss

subtle wren
#

PS. not really on the direct subject. When sending code, please don't send screenshots unless request. Send your code like this

```python
your code here
```

celest vine
#

u want me to paste the code?

#
width = int(input('Enter the Width: '))
length = int(input('Enter the Length: '))
area = width * length
print (width, '*', length, '=', area)
subtle wren
#

yea but it's not necessary for what you previously sent

celest vine
#

sick

subtle wren
#

Oh... to late XD

#

Anyway, it's a good practice haha

celest vine
#

im starting to love this subject

#

thanks man i appreciate it

subtle wren
#

Yea programming is great 🙂

#

Anyway, unless you have other question related to this I'll close this post okay? If you want to continue to chat we can do it in #☕・hangout 🙂

And of course, if you have other questions don't hesitate to open a new one. Just for the next ones, put better titles than Python. It would be greatly appreciated and will increase your chance of getting an answer.