100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Thesis

define different types of data in python.

Rating
-
Sold
-
Pages
4
Grade
A
Uploaded on
21-08-2022
Written in
2022/2023

define different types of data in python.

Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Course

Document information

Uploaded on
August 21, 2022
Number of pages
4
Written in
2022/2023
Type
Thesis
Supervisor(s)
Cbcsk
Year
Unknown

Subjects

Content preview

Defined data types
1. String
A string is a sequence of characters enclosed in quotes.
We can primarily write a string in three ways,
For one-line string…
1. Single quoted string a = 'hello world'
2. Double quoted string a = "hello world"

For multi-line string…
3. Triple quoted string a = """hello world""" or
a = '''hello world'''

Properties of string
 Immutable, but it has methods to delete parts of the string, insert, replace
characters, etc.
 String support accessing / indexing
 The string can be slicing
 In string duplicate characters are allowed

String indexing
We can access individual characters using indexing, Index starts from the left of
the string and has 0 as the starting index. The index must be an integer. We can't
use floats or other types.
Python allows negative indexing for its sequences. The negative index starts
from the right of the string and has -1 as the starting index. The index of -1 refers
to the last item, -2 to the second last item, and so on.
a= h e l l o
0 1 2 3 4
-5 -4 -3 -2 -1
Example
print (a[0]) output = h
print (a[-1]) output = o
$10.49
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
chandbeeshaikh

Also available in package deal

Get to know the seller

Seller avatar
chandbeeshaikh Anjuman I-Islam
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
3 year
Number of followers
0
Documents
4
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions