Why Programming?
Programming is the process of writing instructions that tell a computer what to do.What is a Data Types?
A data type Specific the type of value that a variable can store.What is a Primitive Data Types?
Primitive data types are the basic built-in data types that store a single value.int -> Integer numbers -> (10, -5)
float -> Decimal numbers -> (3.14, 25.5)
str -> Text/String -> ("Hello")
bool -> Boolean values -> (True, False)
Example:
age = 21 -> integer
price = 99.99 -> float
name = "Python" -> string
is_pass = True -> boolean
- What is a Built-in Function in Python?
A built-in function is a function that is already available in Python.
print()
input()
len()
type()
- print() -> Display output on the screen
print("Hello World")
Output
Hello World
- input() -> Takes input form the user
name = input("Enter your name: ")
Output
Enter your name:
- len() -> Returns the length of a string, list, etc.
name = "Python"
print(len(name))
Output
6
- type() -> Returns the data type of a variable
x = 10
print(type(x))
Output
<class 'int'>
Top comments (0)