Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PythonTuple
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#Python 2.7.17 #this code is created by Rezaul Hoque on October 09,2021;contact: jewelmrh@yahoo.com #note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; print \ """ |||||||||||||||||||||||||||| """ pTuple=("Python","Tuple" ,"October",9, 2021, 14.40) #tuple constructor with one item day=tuple(("Time", )) #adding day tuple to pTuple pTuple += day # adding item to tuple: first convert it into list,then append item and finally convert the new list into tuple again add=list(pTuple) add.append(":") add.append(" ") pTuple=tuple(add) #adding tuples hr=pTuple[6]+pTuple[8]+pTuple[7] head=pTuple[0]+pTuple[8]+pTuple[1] #accessing tuple elements print(head[0:]) print(pTuple[2]) print(pTuple [3]) print(",") print(pTuple [4]) print(hr) print(pTuple[5]) print \ """ |||||||||||||||||||||||||||| """
[
+
]
Show input
Absolute running time: 0.18 sec, cpu time: 0.03 sec, memory peak: 7 Mb, absolute service time: 0,34 sec
edit mode
|
history
|
discussion
|||||||||||||||||||||||||||| Python Tuple October 9 , 2021 Time : 14.4 ||||||||||||||||||||||||||||