Skip to main content

what is data type?

Data types


The following table provides an overview of the most frequently used data types in
Python.
Variable type Example Usage comment
You can store data of all types inside a variable using the assignment operator “=”.
Multiline strings can be used to store large text blocks.
long_text = “”” Line one
Line two
Line three
Line Four
“””
As you can see, a multiline string is a normal string enclosed by triple quotes instead of
single ones.
In Python it is possible to convert strings to integers and integers to strings:
>>> str(100)
‘100’
>>> int(“234”)
234




Quiz
PROBLEM:
1. What is the name of this = operator?
2. How to convert a digit 3.14 into a string ‘3.14’?

ANSWER:
1. assignment operator
2. str(3.14)




Next:-Basic math/string operation
                         To be continued Enjoy with python:)

Comments

Popular posts from this blog

What is python variable?

Have you ever forgotten a birthday of a friend relative?computers can hold on to that information if we tell them to.computers use variables to store information? like moving boxes. Variables have content and names that tell us what’s inside. In Python, a variable can be used to store the output of a statement in the computer’s memory.                                                            A=23 The equals sign is used to assign a value to a variable. The name of the variable is called its identifier    FOR ex. Day = “Monday” Now anytime we mention the day in our code. the computer will know that we're referring to the value “Monday” inside of it. Because day stored the ...

why python??

Why Python? When you embark on your computer science journey at college, you’ll probably start by learning Python. So why choose Python over any other programming language? It’s simple: ·         Regardless of your operating system, Python is easy to set up. ·         Python code uses plain English, making it easy to understand. ·         Python will let you run bad code. ·         Why is this good? ·         When you’re learning you’re bound to make mistakes. ·         Python tells you what the error is after you run the code, helping you to find the ·         problem. ·         Python is a very powerful tool, but it’s also easy and fast to learn, which is why ·   ...