Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8370721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:58:53+00:00 2026-06-09T13:58:53+00:00

This is my program (a very simple one): __author__=soham __date__ =$Aug 12, 2012 4:28:51

  • 0

This is my program (a very simple one):

__author__="soham"
__date__ ="$Aug 12, 2012 4:28:51 PM$"

from math import sqrt

class Point:
    x = 0;
    y = 0;
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __eq__(self, other):
        return self.__dict__ == other.__dict__

    def get_dist(self, other):
        return sqrt(abs((self.x - other.x)^2 + (self.y - other.y)^2))

    def is_rect(self,other,another,yet_another):
        return (self.get_dist(other) == another.get_dist(yet_another)) and \
               (self.get_dist(another) == other.get_dist(yet_another)) and \
               (self.get_dist(yet_another) == other.get_dist(another))


a, b, c, d = Point(4,3),Point(4,9), Point(7,3), Point(7,9)

if a.is_rect(b,c,d):
    print "Rectangle."
else:
    print "No, not a rectangle!"

This returns no. A similar program written in Java returns the expected answer.

I’m very new to Python. Help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:58:54+00:00Added an answer on June 9, 2026 at 1:58 pm

    Exponentiation in Python is **, not ^.

    ^ in Python is actually the bitwise xor operator.

    For exponentation, you can also do pow(x,y) instead of x**y.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I made this (very simple) program with a swing GUI with NetBeans, and
I was making this very simple lex program (just an introductory program). But on
This one is probably very simple, but I can't seem to get it working.
I have a very simple program that I am trying to improve performance. One
So I made a very simple program that counts down from 99 (sings 99
I'm very new to C, but have no idea why this program breaks. The
I'm having a very big struct in an existing program. This struct includes a
This program returns: package main import ( flag fmt ) func main() { num_agents
this program is for class to display the database in Listview.i want to add
Recently I have gone through with one simple threading program, which leads me some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.