Q:

Explain the three data types (integer ,string and Boolean) give the example of each one using python statements

0

Explain the three data types (integer ,string and Boolean) give the example of each one using python statements

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

 

'

 

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now