PYTHON AND HADOOP BASICS: PROGRAMMING FOR BEGINNERS - 2 BOOKS IN 1 - Learn Coding Fast! PYTHON AND HADOOP Crash Course, A QuickStart Guide, Tutorial Book by Program Examples, In Easy Steps! by SEL TAM & KING J
Author:SEL, TAM & KING, J [SEL, TAM]
Language: eng
Format: epub
Published: 2020-07-08T16:00:00+00:00
Output:
HelloHelloHello
Hello world
o
ll
False
False
C://python37
The string str : Hello
Python Tuple
Python Tuple is used to store unchanged Python object set. The tuple is similar to lists since it is possible to adjust the value of the items stored in the array, whereas the tuple is immutable and it is not possible to alter the value of the items stored in the tuple.
A tuple can be written as a collection of comma-separated(,) values accompanied by the small() brackets. The parentheses are optional but use of them is good practice. They may describe a tuple as follows.
T1 = ( 101 , "Peter" , 22 )
T2 = ( "Apple" , "Banana" , "Orange" )
T3 = 10 , 20 , 30 , 40 , 50
print(type(T1))
print(type(T2))
print(type(T3))
Output:
<class 'tuple'>
<class 'tuple'>
<class 'tuple'>
A tuple is indexed as is the case for the lists. You can view the items in tuple using their unique index value.
Example - 1
tuple1 = ( 1 0 , 2 0 , 3 0 , 4 0 , 5 0 , 6 0 )
print(tuple1)
count = 0
fo r i in tuple1:
print ( "tuple1[%d] = %d " %(count, i))
count = count + 1
Output:
(10, 20, 30, 40, 50, 60)
tuple1[0] = 10
tuple1[1] = 20
tuple1[2] = 30
tuple1[3] = 40
tuple1[4] = 50
tuple1[5] = 60
Example - 2
tuple1 = tuple(input( "Enter the tuple elements ... " ))
print(tuple1)
count = 0
fo r i in tuple1:
print( "tuple1[%d] = %s " %(count, i))
count = count+ 1
Output :
Enter the tuple elements ...123456
('1', '2', '3', '4', '5', '6')
tuple1[0] = 1
tuple1[1] = 2
tuple1[2] = 3
tuple1[3] = 4
tuple1[4] = 5
tuple1[5] = 6
Basic Tuple operations
Operator
Description
Example
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Access | Data Mining |
Data Modeling & Design | Data Processing |
Data Warehousing | MySQL |
Oracle | Other Databases |
Relational Databases | SQL |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(7846)
Learning SQL by Alan Beaulieu(5400)
Weapons of Math Destruction by Cathy O'Neil(5032)
Big Data Analysis with Python by Ivan Marin(2966)
Blockchain Basics by Daniel Drescher(2884)
Pandas Cookbook by Theodore Petrou(2496)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2491)
Mastering Python for Finance by Unknown(2466)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(2398)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(2364)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(2305)
How The Mind Works by Steven Pinker(2207)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(2079)
Building Machine Learning Systems with Python by Richert Willi Coelho Luis Pedro(2056)
Data Engineering with dbt by Roberto Zagni(2006)
Network Science with Python and NetworkX Quick Start Guide by Edward L. Platt(1953)
Driving Data Quality with Data Contracts by Andrew Jones(1948)
Python Natural Language Processing by Jalaj Thanaki(1888)
Solidity Programming Essentials by Ritesh Modi(1762)