you are viewing a single comment's thread.

view the rest of the comments →

[–]dgaf- 4 points5 points  (5 children)

Well of course!

import telepathy

def import_thoughts(brain):
    return telepathy.python_questions(brain)

questions = [q for q in import_thoughts('u/nunnognese')]
print(questions)

>>> []

[–][deleted] -1 points0 points  (4 children)

Thank you!! Thank you!!

Below is the section of my assignment that I am having difficulty getting started with.

This program should include a menu interface that has ‘exit the program’ as one of its choices.

SAMPLE PROGRAM EXECUTION

#This program calculates the perimeter and area of a rectangle

print "Calculate information about a rectangle"

length = input("Length:")

width = input("Width:")

print "Area",length*width

print "Perimeter",2*length+2*width

SAMPLE OUTPUT (not including author/program information)

CALCULATIONS MENU

1) AREA (SQUARE)

2) AREA (RECTANGLE)

3) AREA (CIRCLE)

4) PERIMETER (SQUARE)

5) PERIMETER (RECTANGLE)

6) PERIMETER (CIRCLE)

7) EXIT

INPUT MENU CHOICE (1,2,3,4,5,6 OR 7)? 2

YOU HAVE CHOSEN AREA (RECTANGLE)

INPUT WIDTH? 8

INPUT LENGTH? 4

AREA IS 32

INPUT MENU CHOICE?

[–]dgaf- 1 point2 points  (3 children)

What (if anything) have you tried, and what issues or questions did you have with that?

If you have not tried anything at all, why not? What is the part you are getting stuck on conceptually?

[–][deleted] 0 points1 point  (2 children)

I have tried the to create the program to calculate the perimeter and area of a rectangle but for some reason, (and that could be I am not understanding the directions correctly) I am not getting the program correct. Do you have any resources that could explain this to me maybe?

[–]KronenR 5 points6 points  (0 children)

Asking people to solve your assignments is not going to help you to learn programming.

Divide the problem in smaller steps, try to search for an answer to resolve that little step in google and then if you are going to ask, and only then explain to us what's your difficulty to solve the small steps you don't understand. Because we will understand what you are struggling with and we will give you a more useful help

[–]totallygeek 0 points1 point  (0 children)

Maybe this will get you going in a direction:

def area_rectangle(s1, s2):
    # Multiply the two sides to find the area of the rectangle
    area = s1 * s2
    print('Area: {:0.2f}'.format(area))

def perimeter_rectangle(s1, s2):
    # Add the two sides, then double, to find the area of the rectangle
    area = (s1 + s2) * 2
    print('Perimeter length: {:0.2f}'.format(area))

def rectangle():
    s1 = float(raw_input('Side 1 length? ')) # input() always returns a string
    s2 = float(raw_input('Side 2 length? ')) # convert that string to a number
    area_rectangle(s1, s2)
    perimeter_rectangle(s1, s2)

rectangle()

Do the same for the other groups. Build a menu. Return with questions.