Showing posts from May, 2022
Write a program to add two numbers with user input Program # create variable that Store input values x = input('enter first number: ') y = input('enter second numbe…
Python | Set Sets are used to store multiple items in a single variable. Set are one of four datatype in python Set is collection which is unordered, unchangeable , and unindexed Set are written between curly brackets Exa…
python | concatenate tuples you can use for + operation concate , merge two tuples Example tuple1 = ('mango' ,' banana', 'mango' , 'graps' ) tuple2 = ('apple…
Python | Loop through tuple for loop using for loop you can print the tuple items one by one. Example tuple = ('mango' ,' banana', 'apple', 'mango' , 'graps' , 'ap…
Python | Tuple Method and Function len() Function len() is used for get the length of tuple Example tuple = ('mango' ,' banana', 'apple', 'mango' , 'graps' , 'ap…
Access Items in Tuple You can access items in a tuple by referring to an index Tuple items are indexed start from 0 ( Zero ), second index is 1.... Example tuple = ('mango' ,' banana', '…
Comment PYTHON | Comment Comments are used for to explain the python code Comments are used for to make more readable Comments are not considered when running the program there are two types of comments 1) single…
Python | Tuple A tuple in Python is similar to a list. Tuple is one of 4 built-in data types in Python used to store collections of data Tuples are collection of data which is order and unchangeable Tuples are writ…
Write a Program to add two numbers in python Program # variable to store value num1 = 5 num2 = 6 # now create third variable that should store summation of two variable num1 and num2 sum = num1 + num2 # show the ou…
python sort list Sort list sort() Method is sort the list alphanumerically , ascending order to sort by default. Example list = [ 'mango' , 'apple', 'kiwi' , 'orange' , 'pinea…
python concatenate list Concatenate Two list Concatenation of two list , using ' + ' Operator you can concatenate two list Example list1 = [ 'mango' , 'apple', 'kiwi' , …