Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
3

How to fix type error in python?

727Nerd
727Nerd

A part of my code is: def TcKTcKTcK():

print(TcK)
TcKTcKTcK = input("Say yes")

if TcKTcKTcK == "yes":
print("Congratulations! You followed my instruction!")

if TcKTcKTcK == "Yes":
print("Congratulations! You followed my instruction!")

if TcKTcKTcK != "yes" and TcKTcKTcK != "Yes":
print("You failed to follow my instruction!")
print("Try again!")
TcKTcKTcK()

TcKTcKTcK()

and, when someone said no the result was...
TypeError: 'str' object is not callable.

My question is how do I fix this?

By the way, TcK is a variable from previous questions in this code.

3 years ago
You are viewing a single comment. View All
3