Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prac04,Task2.5.2 #31

Open
gabriellaYSL opened this issue Oct 26, 2022 · 0 comments
Open

Prac04,Task2.5.2 #31

gabriellaYSL opened this issue Oct 26, 2022 · 0 comments

Comments

@gabriellaYSL
Copy link

prac 04, task2.5.2.md

def to_type(cdata, ctype):
    # If a string
    if isinstance(cdata, str):
        try:
            if ctype==bool:
                return cdata==True

In this part, when cdata='True' and ctype='bool', it will never and ever return True. Cuz a string 'True' won't equals a bool True.
So it should be

return cdata == True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant