GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing codescracker.com — Python True Keyword
Python True KeywordThe "True" keyword in Python is basically a Boolean value. There are two boolean values: True and False. The "True" is basically a result of:
For example: a = 10 b = 20 c = 10 print(a==c) print(a<b) The output is: True True Python True keyword exampleTrue is the result of a boolean operation. That is, if the expression(s) of a boolean operation evaluate to be True, then the condition evaluates to be True. Here is an example that demonstrates it: print("Enter any Two Values: ", end="") a = input() b = input() x = a==b if x: print("\nBoth values are equal") else: print("\nBoth values are not equal") print("\nThe value of x =", x) The snapshot given below shows the sample run of the above program, with user input "codescracker" as the first and second values: Advantages of the True keyword in Python
Disadvantages of the True keyword in Python
The "True" keyword should be used with caution and intelligence to avoid errors and ambiguity in programming. The "True" keyword enables more intricate logical operations and algorithm design. « Previous Tutorial Next Tutorial » Practice Quizzes
Test your programming and computer science knowledge with interactive MCQs and topic-based quizzes. Popular Topics
Explore the most popular programming and computer science tutorials on CodesCracker. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |