Python Programming tutorial provides basic and advanced concepts of Python programming. This Python programming tutorial is designed for beginners and professionals. Python is a simple, general purpose, high level, and object-oriented programming language. In this we have different chapter and their concepts Python Programming : tokens, literals, identifiers, keywords, special symbols and operators; fundamental data types, expressions, type conversions, handling Input and output in Python. Selection Statements : if statement, if-else statement, if-elif-else statement, nested-if statement. Iterative Statements : while loop, for loop, break statement, continue statement, pass and else statements used with loops. Sequences : Lists and operations - creating, inserting elements, updating elements, deleting elements, searching and sorting, list comprehensions, nested lists; tuples - creating, searching and sorting, nested tuples; strings - Initializing a...
''' 1. Tuple is used to store multiple values and we can do operation on each value based on index. 2. Tuple is a read only object, we can't do update,insert and delete operations. 3. Using parentheses "()" we can create a tuple 4. tuple is a immutable object 5. To store sensitive data we use tuple. ''' # To create a tuple names = ('umamahesh','kumar','balu','ram', 567, 99.9) # Tuple doesn't support for item deltion and update names[3] = 'ok' del names[3] # To print particular value based on index print(names[4]) print(names[-1]) # To delete a total tuple del names
''' 1. Using string we can store any value but it should be in single quotes or double quotes. 2. String is a immutable object ''' # To define a string variable # name = 'sri123$#% &' # print('name is:', name) # print('\n memory location for name is :', id(name)) # If string contains double quote name1 = " I don't 'know' umamahesh" print('name is:', name1) print('\n memory location for name is :', id(name1)) # If string contains double quote # name2 = ' I know "sriram"' # If string contains single quote and double quote #name3 = ''' I don't know "sriram"''' # To update #name = 'kumar' #print(name) # To Delete #del name # To Print on console #print(' Name is : ', name)
Comments
Post a Comment