Showing posts with the label Tuples and Dictionaries

Write a program to input your friends’ names and their Phone Numbers and store them in the dictionary as the key-value pair.

Q. Write a program to input your friends’ names and their Phone Numbers and sto…

Write a Python program to create a dictionary from a string.

Q. Write a Python program to create a dictionary from a string. Note: Track the…

Write a Python program to find the highest 2 values in a dictionary.

Q. Write a Python program to find the highest 2 values in a dictionary. Answer …

Write a program to input names of n students and store them in a tuple.

Q. Write a program to input names of n students and store them in a tuple. Also…

Write a program to read email IDs of n number of students and store them in a tuple.

Q. Write a program to read email IDs of n number of students and store them in …

TypeError occurs while statement 2 is running. Give reason. How can it be corrected?

Q. TypeError occurs while statement 2 is running.  Give reason. How can it be c…

Prove with the help of an example that the variable is rebuilt in case of immutable data types.

Q. Prove with the help of an example that the variable is rebuilt in case of im…

When to use tuple or dictionary in Python. Give some examples

Q. When to use tuple or dictionary in Python. Give some examples of programming…

What advantages do tuples have over lists?

Q. What advantages do tuples have over lists? Answer:- Advantages of tuples ov…

With the help of an example show how can you return more than one value from a function?

Q. With the help of an example show how can you return more than one value from…

Lists and Tuples are ordered. Explain.

Q. “Lists and Tuples are ordered”. Explain. Answer :- Lists and Tuples are orde…

Consider the following dictionary stateCapital:

Q. Consider the following dictionary stateCapital: stateCapital = {"Andhra…

tuple1=(23,1,45,67,45,9,55,45) tuple2=(100,200) Find the output of the following statements:

Q. Consider the following tuples, tuple1 and tuple2: tuple1 = (23,1,45,67,45,9,…

Load More That is All