Sequence data types in python

Python : Sequence data types in python Program List




Program [1]

WAP to find the 2nd largest number from the list of the numbers entered through keyboard.


View Solution


Program [2]

Write a python program that creates a list of numbers from 1 to 20 that are divisible by 4


View Solution


Program [3]

Write a python program to define a list of countries that are a member of BRICS. Check whether a county is member of BRICS or not


View Solution


Program [4]

Python program to read marks of six subjects and to print the marks scored in each subject and show the total marks


View Solution


Program [5]

Python program to read prices of 5 items in a list and then display sum of all the prices, product of all the prices and find the average


View Solution


Program [6]

Python program to count the number of employees earning more than 1 lakh per annum. The monthly salaries of n number of employees are given


View Solution


Program [7]

Write a program to create a list of numbers in the range 1 to 10. Then delete all the even numbers from the list and print the final list.


View Solution


Program [8]

Write a program to generate in the Fibonacci series and store it in a list. Then find the sum of all values.


View Solution


Program [9]

Write a program to swap two values using tuple assignment


View Solution


Program [10]

Write a python program using a function that returns the area and circumference of a circle whose radius is passed as an argument.two values using tuple assignment


View Solution


Program [11]

Write a program that has a list of positive and negative numbers. Create a new tuple that has only positive numbers from the list


View Solution


Program [12]

Python Program that generate a set of prime numbers and another set of even numbers. Demonstrate the result of union, intersection, difference and symmetirc difference operations.


View Solution


Program [13]

WAP to find minimum element from a list of elements along with its index in the list.


View Solution


Program [14]

WAP to calculate mean of a given list of numbers.


View Solution


Program [15]

WAP to search for an element in a given list of numbers.


View Solution


Program [16]

WAP to count frequency of a given element in a list of numbers.


View Solution


Program [17]

WAP to calculate the sum of integers of the list


View Solution


Program [18]

WAP that reverses an array of integers (in place)


View Solution


Program [19]

WAP that creates a third list after adding two lists.


View Solution


Program [20]

WAP that repeatedly asks the user to enter product names and prices. Store all of them in a dictionary whose keys are product names and values are prices. And also write a code to search an item from the dictionary.


View Solution


Program [21]

WAP to create a dictionary named year whose keys are month names and values are their corresponding number of days.


View Solution


Program [22]

write  a program that input a list, replace it twice and then prints the sorted list in ascending and descending order.


View Solution


Program [23]

write a program to check if the maximum element of the list lies in the first half of the list or in the second half.


View Solution


Program [24]

write a program to input two lists and display the maximum elements from the elements of both the list combined, along with its index in its list.


View Solution


Program [25]

write a program to input a list of numbers and swap elements at the even location with the elements at the odd location.


View Solution


Program [26]

Write a program rotates the elements of a list so that the elements at the first index moves to the second index , the element in the second index moves to the third index, etc., and the element at the last index moves to the first index.


View Solution


Program [27]

Write a program to input ‘n’ numbers and store it in a tuple and find maximum & minimum values in the tuple.


View Solution


Program [28]

Write a program to input any two tuples and interchange the tuple values.


View Solution


Program [29]

Write a program to input any two tuples and interchange the tuple values.


View Solution


Program [30]

Write a python program to increment the elements of a list with a number.


View Solution


Program [31]

Ask the use to enter a list containing number between 1 and 12, then replace all the entries in the list that are  greater than 10 with 10


View Solution


Program [32]

Write a Python program that reverse a list of integers (in place)


View Solution


Program [33]

Write a python program that inputs two lists and creates a third, that contains all elements of the first followed by all elements of the second. 


View Solution


Program [34]

Ask the user to inter list of string. Create a new list that consist of those strings with their first characters removed.


View Solution


Program [35]

Write a Python program to Create a list using for loop which consist of integers 0 through 49


View Solution


Program [36]

Write a Python program to create a list using for loop which consist square of  the integers 1 through 50


View Solution


Program [37]

Write a Python program to create a list using for loop which consist ['a','bb','ccc','dddd',....] that ends with 26 copies of the letter z.


View Solution


Program [38]

Write a python program that takes any two list L and M of the same size and adds their elements together to from a new list N whose elements are sums of the corresponding elements in L and M. For instance, if L=[3,1,4] and M= [1,5,9] the N should equal [4,6,13].



View Solution


Program [39]

Write a python program to rotates the elements of a list so that the elements at the first index moves to the second index, the element in the second index moves to the third index, etc. and the elements in the last index moves to the first index.


View Solution


Program [40]

Write a python program to move all duplicate values in a list to the end of the list.


View Solution


Program [41]

Write a Python program display the maximum and minimum values form specified range of indexes of a list


View Solution


Program [42]

Write a python program to compare two equal sized list and print the first index where they differ


View Solution


Program [43]

Write a Python program to enter names of employees and their salaries as input and store them in a dictionary


View Solution


Program [44]

Write a program to count the number of times a character appears in a given string


View Solution


Program [45]

Write a program to convert a number entered by the user into its corresponding number in words.

For example, if the input is 876 then the output should be 'Eight Seven Six'.


View Solution


Program [46]

Repeatedly ask the user to enter a team name and how many games the team has won and how many they lost. Store this information in a dictionary where the keys are the team names and the values are a list of the form [wins, losses ].


(i) using the dictionary created above, allow the user to enter a team name and print out the team’s winning percentage.

(ii) using dictionary create a list whose entries are the number of wins for each team.

(iii) using the dictionary, create a list of all those teams that have winning records.


View Solution


Program [47]

Write a program that repeatedly asks the user to enter product names and prices. Store all of these  in a dictionary whose keys are the product names and whose values are the price .

When the user is done entering products and price, allow them to repeatedly enter a product name and print the corresponding price or a message if the product is not in dictionary.


View Solution


Program [48]

Create a dictionary whose keys are month name and whose values are number of days in the corresponding month:

(a) ask the user to enter the month name and use the dictionary to tell how many days are in month .

(b) print out all of the keys in alphabetical order  .

(c) print out all of the month with 31 days.

(d) print out the (key - value) pair sorted  by the number of the days in each month .


View Solution


Program [49]

Can you store the detail of 10 students in a dictionary at the same time? details include – rollno, name ,marks ,grade etc. Give example to support your answer.


View Solution


Program [50]

Given the dictionary x = {‘k1’: ‘v1’, ‘k2’ : ‘v2’, ‘k3’ : ‘v3’} ,create a dictionary with the opposite mapping.

Write a program to create the dictionary .


View Solution


Program [51]

Given two dictionaries say d1 and d2

Write a program that lists the over lapping keys of the two dictionaries if a key of d1 is also a key of d2 , the list it .


View Solution


Program [52]

Write a program that checks if two same values in a dictionary have different keys. 


View Solution


Program [53]

Write a program to check if a dictionary is contained in another dictionary.

 

e.g., if

 

d1 = {1:11, 2:12}

d2 = {1:11, 2:12, 3:13, 4:15}

 

Then d1 is contained in d2.


View Solution


Program [54]

A dictionary D1 has values in the form of lists of numbers. Write a program to create a new dictionary D2 having same keys as D1 but values as the sum of the list elements.

 

e.g.

 

D1 = {'A': [1, 2, 3], 'B': [4, 5, 6]}

Then

D2 is {'A':6, 'B': 15}


View Solution


Program [55]

A dictionary has three keys: 'assets', 'liabilities' and 'capital'. Each of these keys store their value in form of a list storing various values of 'assets', liabilities' and 'capital' respectively. Write a program to create a dictionary in this form and print. Also test if the accounting equation holds true.


View Solution


CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Website development Company in Allahabad