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 TAM SEL & J KING
Author:TAM SEL & J KING [SEL, TAM]
Language: eng
Format: azw3
Published: 2020-07-10T16:00:00+00:00
print (r 'C://python37' ) # prints C://python37 as it is written
print ( "The string str : %s" %(str)) # prints The string str : Hello
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
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(7851)
Learning SQL by Alan Beaulieu(5411)
Weapons of Math Destruction by Cathy O'Neil(5036)
Big Data Analysis with Python by Ivan Marin(3006)
Blockchain Basics by Daniel Drescher(2890)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2517)
Pandas Cookbook by Theodore Petrou(2501)
Mastering Python for Finance by Unknown(2474)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(2471)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(2438)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(2374)
How The Mind Works by Steven Pinker(2213)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(2154)
Building Machine Learning Systems with Python by Richert Willi Coelho Luis Pedro(2058)
Data Engineering with dbt by Roberto Zagni(2051)
Driving Data Quality with Data Contracts by Andrew Jones(2023)
Network Science with Python and NetworkX Quick Start Guide by Edward L. Platt(1971)
Python Natural Language Processing by Jalaj Thanaki(1892)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(1817)