Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: why is this not working
Post: RE: why is this not working

On line 4 there are two open brackets but only one close bracket, add the missing close bracket to the end of the line. Note: Also it looks like the code has been altered since the error trace that h...
Yoriz General Coding Help 1 235 Jun-06-2022, 04:58 PM
    Thread: [SOLVED] How to change button label?
Post: RE: [wxPython] How to change button label?

To be able to have a pointer to the button object in the event handler method on_press you need to add self. to the front of my_btn in the __init__ method. Then you can use the buttons SetLabel method...
Yoriz GUI 3 255 May-31-2022, 05:39 PM
    Thread: GUI Opens Minimized
Post: RE: GUI Opens Minimized

You should not need to post the whole code but I expect just a bare minimum of code that displays a tkinter window that shows the problem at hand would be required.
Yoriz GUI 24 1,236 Apr-12-2022, 06:07 PM
    Thread: meaning of -> syntax in function definition
Post: RE: meaning of -> syntax in function definition

If you are using a version older than 3.9 you would need to import List from the typing module from typing import List def getWords(self) -> List[str]: .... From version python 3.9 you can use...
Yoriz General Coding Help 5 484 Apr-08-2022, 07:40 PM
    Thread: <= not supported but I already use int as an input
Post: RE: <= not supported but I already use int as an i...

This could be the issue ( i have not run your code) def Balance (self,balance): self.bankBalance = "0" + str(balance) print ("The Available balance is ",balance)is assigning self.b...
Yoriz Homework 2 423 Apr-07-2022, 02:44 PM
    Thread: How to print out the children index of the search tree?
Post: RE: How to print out the children index of the sea...

Some of the posts by @longmen have been reverted back to the originals as they were all changed to Quote:Please disregard this I received a PM regarding deleting this please read the following link Ed...
Yoriz Homework 7 703 Apr-02-2022, 06:58 AM
    Thread: Making Code Cleaner
Post: RE: Making Code Cleaner

text_test = "Hello" text_test2 = " there world" text_test_answer = "".join((text_test, text_test2)) answers = text_test_answer.split() result = " ".join(answers[index] for index in (1, 2, 0)) print(re...
Yoriz Homework 1 412 Mar-26-2022, 01:50 PM
    Thread: list sort() function bring backs None
Post: RE: list sort() function bring backs None

That is because the list sort method sorts in place and returns None list1 = [3, 4, 1, 2] list2 = list1.sort() print(list1) print(list2)Output:[1, 2, 3, 4] NoneUse sorted if you want to get a sperate ...
Yoriz General Coding Help 6 671 Mar-20-2022, 09:04 PM
    Thread: Why is the if construct not calculating correctly?
Post: RE: Why is the if construct not calculating correc...

If you want to actually add the total you need to add the additional amount to the previous total >>> total = 1 >>> total = total + 1 >>> total 2
Yoriz General Coding Help 21 1,145 Mar-19-2022, 06:18 PM
    Thread: [split] TypeError: 'int' object is not callable
Post: RE: GUI programming PyQt 5 + Qt Designer

https://docs.python.org/3/library/random...om.shuffle Wrote:Shuffle the sequence x in place. The optional argument random is a 0-argument function returning a random float in [0.0, 1.0); by default, ...
Yoriz General Coding Help 4 699 Mar-19-2022, 06:07 PM
    Thread: Why is the if construct not calculating correctly?
Post: RE: Why is the if construct not calculating correc...

sum is never assigned as 2 sum is only assigned as 0 or 1 no actually summing is done
Yoriz General Coding Help 21 1,145 Mar-19-2022, 05:57 PM
    Thread: Beginner Boolean question [Guessing game]
Post: RE: Beginner Boolean question [Guessing game]

out_of_guesses has initially been assigned as False because the following while statement will only loop if this is False not isn't a function its a logical operator the brackets are not needed here...
Yoriz General Coding Help 4 556 Mar-19-2022, 03:33 PM
    Thread: Exercism with Python
Post: RE: Exercism with Python

What does the test says it expects your function to return, compared to what you have actually returned?
Yoriz Homework 8 933 Mar-17-2022, 06:26 AM
    Thread: asking help
Post: RE: asking help

@JHONG_JOBANIE1995 Please view the links in my signature and in particular the homework one.
Yoriz Homework 5 780 Mar-16-2022, 06:21 AM
    Thread: Exercism with Python
Post: RE: Exercism with Python

Print should be all lower case and you need to call the function hello def hello(): print("hello world") return "Goodbye, Mars!" ######## print(hello())Output:hello world Goodbye, Mars!
Yoriz Homework 8 933 Mar-15-2022, 06:20 AM
    Thread: looking for list help
Post: RE: looking for list help

items = [1, 2, 3] items.append(4) print(items)Output:[1, 2, 3, 4]
Yoriz General Coding Help 1 376 Mar-14-2022, 12:27 AM
    Thread: Keeping a value the same despite changing the variable it was equated to
Post: RE: Keeping a value the same despite changing the ...

The list that is referenced by currentPath that is appended to the list referenced by completedPaths is not a copy of the list it is the same list. currentPath = ["EWR", "JFK", "SFO"] completedPaths =...
Yoriz General Coding Help 2 447 Mar-13-2022, 10:50 PM
    Thread: ATM machine (deposits/withdrawals) using OOP
Post: RE: ATM machine (deposits/withdrawals) using OOP

You are writing class methods like they are functions. You need to make use of self, the balance state can be kept as an instance attribute. class BankAccount: def __init__(self, first_name, last_...
Yoriz General Coding Help 17 1,375 Mar-09-2022, 11:19 PM
    Thread: an array to count votes
Post: RE: an array to count votes

Welcome to the forum, please view the links in my signature.
Yoriz Homework 2 471 Mar-09-2022, 06:30 AM
    Thread: Proper way to do the OR statement?
Post: RE: Proper way to do the OR statement?

Because this comes up often there is a stickied thread in Tutorials > Common pitfalls and what to do. Multiple expressions with "or" keyword
Yoriz General Coding Help 5 603 Mar-01-2022, 06:20 AM

User Panel Messages

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