Explain the three data types (integer ,string and Boolean) give the example of each one using python statements
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
There are three fundamental data types: integer, string, and boolean.
1- Integer: An integer is a whole number without any decimal points. In Python, integers are represented by the int type. They can be positive or negative.
Example:
x = 5
y = -10
2- String: A string is a sequence of characters. In Python, strings are represented by the str type. They are enclosed in quotes (either single or double quotes)
Example:
name = "Ahmad"
message = 'Hello
3- Boolean: A boolean value is either True or False. In Python, booleans are represented by the bool type.
Example:
is_raining = True
is_sunny = False
'