Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Class and calling a method
Post: RE: Class and calling a method

I got it thanks!
Zatoichi Homework 3 3,092 Mar-13-2018, 08:44 PM
    Thread: Turtle drawing Right Triangle
Post: RE: Turtle drawing Right Triangle

I had to add some if and elif statements for different scenarios of coordinates. For example if if say point A was (-x, -y) and point B was (-x, y) and I just found all the different combinations and ...
Zatoichi Homework 3 5,715 Feb-26-2018, 12:24 AM
    Thread: Someone please look at this and tell me what i'm doing wrong
Post: RE: Someone please look at this and tell me what i...

This is in python 3 but this should work def volume(h, r): print (( h * ( r**2 ) * ( 22 / 7)) / 3) volume(4,4)Output:67.04761904761905
Zatoichi Homework 2 2,441 Feb-24-2018, 04:38 AM
    Thread: Class and calling a method
Post: Class and calling a method

class student: def __init__(self, first_name, last_name, student_id, year): self.first_name = first_name self.last_name = last_name self.student_id = student_id ...
Zatoichi Homework 3 3,092 Feb-24-2018, 04:32 AM
    Thread: Turtle drawing Right Triangle
Post: RE: Turtle drawing Right Triangle

I solved it!
Zatoichi Homework 3 5,715 Feb-19-2018, 12:09 AM
    Thread: Turtle drawing Right Triangle
Post: Turtle drawing Right Triangle

from turtle import Turtle import random from math import sqrt, degrees, asin, acos, atan class Shape(): turtle = Turtle() class Circle(Shape): def __init__(self, center, radiu...
Zatoichi Homework 3 5,715 Feb-18-2018, 10:52 PM
    Thread: printing list of random generated rectangles
Post: RE: printing list of random generated rectangles

Thanks for all the help! I am curious buran what does the @property do?
Zatoichi Homework 8 7,334 Feb-18-2018, 05:15 PM
    Thread: Integer object error
Post: RE: Integer object error

thanks! that is my fault for not thoroughly going over my program.
Zatoichi Homework 2 3,722 Feb-18-2018, 07:25 AM
    Thread: Integer object error
Post: Integer object error

from turtle import Turtle import random class Shape(): turtle = Turtle() class Circle(Shape): def __init__(self, center, radius): self.center = center self.cent...
Zatoichi Homework 2 3,722 Feb-18-2018, 12:12 AM
    Thread: printing list of random generated rectangles
Post: RE: printing list of random generated rectangles

import random class Rectangle: def __init__(self, width, height): self.width = width self.height = height def get_width(self): return self.width def get_...
Zatoichi Homework 8 7,334 Feb-17-2018, 10:22 PM
    Thread: printing list of random generated rectangles
Post: printing list of random generated rectangles

import random class Rectangle: def __init__(self, width, height): self.width = width self.height = height def get_width(self): return self.width def get_...
Zatoichi Homework 8 7,334 Feb-17-2018, 01:38 AM
    Thread: I give up...Please help.
Post: RE: I give up...Please help.

use if, elif and else statements like so: if x < lo: return lo elif x > hi: return hi else: return xalso helps to put in your code so we can it as a whole also do you want it to retu...
Zatoichi Homework 4 3,215 Feb-17-2018, 01:27 AM
    Thread: Translator
Post: RE: Translator

Thanks for all the help!
Zatoichi Homework 13 28,950 Feb-15-2018, 04:01 AM
    Thread: Translator
Post: RE: Translator

How do I fix the recursion part when they ask for more than one translation?
Zatoichi Homework 13 28,950 Feb-14-2018, 03:34 AM
    Thread: Translator
Post: RE: Translator

Sorry, my fault for not realizing it sooner. Thanks! counts = {} def load_dictionary(filename): #load the dictionary text file English to Hmong dictionary = {} with open('Hmong.txt', ...
Zatoichi Homework 13 28,950 Feb-13-2018, 03:04 AM
    Thread: Translator
Post: RE: Translator

That works okay if I know how many times the user will use the translation before quitting but if I have no idea it really does not work. I guess I will have to keep searching how to do it.
Zatoichi Homework 13 28,950 Feb-13-2018, 02:16 AM
    Thread: Translator
Post: RE: Translator

How do I go about doing that? Making a global counter?
Zatoichi Homework 13 28,950 Feb-12-2018, 12:52 AM
    Thread: Translator
Post: RE: Translator

will that counting method keep track of all words entered in each input though? and not just the last input the user did before they quit the program.
Zatoichi Homework 13 28,950 Feb-12-2018, 12:41 AM
    Thread: Translator
Post: Translator

def load_dictionary(filename): dictionary = {} with open('Hmong.txt', 'r') as input_file: for lines in input_file: info = lines.strip('\n').split(',') dic...
Zatoichi Homework 13 28,950 Feb-11-2018, 09:13 PM
    Thread: dictionary from file
Post: RE: dictionary from file

I did and it does not make any sense. So back to the drawing board. ['ÿþ1\x00', '\x00r\x00a\x00w\x00s\x00 \x00l\x00i\x00', '\x00a\x00s\x00'] ['\x00'] I figured it out my text file was saved as a uni...
Zatoichi Homework 5 3,821 Feb-11-2018, 07:07 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020