Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
# Hello World program in Python
list = [ 'abcd', 786, 2.23, 'john', 70.2 ]
tinylist = [123, 'john']
print list
print list [0]
print list [1:3]
print list [2:]
print tinylist *2
print list + tinylist
print("the answer can't be two! ")
x=input("")
y=input("")
z="{}+{}".format(x, y,)
b=(2)
e=(int(x)) + (int(y))
print("you are doing: ")
print(z)
print("now to check, ")
if (e) == (b):
print("that no work, because it 2...")
else:
print("good job billy you be doing the good stuff!")
#!/usr/bin/python
str = 'Hello World!'
print str # Prints complete string
print str[0] # Prints first character of the string
print str[2:5] # Prints characters starting from 3rd to 5th
print str[2:] # Prints string starting from 3rd character
print str * 2 # Prints string two times
print str + "TEST" # Prints concatenated string
#!/usr/bin/python
list = [ 'abcd', 786 , 2.23 , 'john', 70.2 ]
tinylist = [123, 'john']
print list # Prints complete list
print list[0] # Print first element of the list
print list[1:3] # Prints elements starting from 2nd till 3rd
print list[2:] # Prints elements starting from 3rd element
print tinylist * 2 # Prints list two time
print list + tinylist # Prints concatenated list
# Hello World program in Python
print "Hello World!\n"
import re
def special_match(strg, search=re.compile(r'[^\ (img\)]').search):
return not bool(search(strg))
print("imaaaaasaassg sadasd asdasd")
print(special_match("(img) (img) (img)"))
#!/usr/bin/python
list = [ 'abcd', 786 , 2.23, 'john', 70.2]
tinylist = [123, 'john']
print list # Prints complete list
print list[0] # Prints first element of the list
print list[1:3] # Prints elements starting from 2nd till 3rd
print list[2:] # Prints element starting from 3rd element
print tinylist * 2 # Print list two times