Python Coding Questions (15)
Create a list of numbers from 1 to 5. Then add the number 6 to the list using a method. Print the updated list.
Given the list
[1,2,3,9,4,6,7,8], write a program to find and print the highest number.Concatenate the first name
"Jason"and last name"Kingsley"to form a full name. Print the result.You have a cash value
'50'. Print it with a dollar sign in front (e.g.,$50).Given the list of fruits
['apple','banana','mango','coconut'], print the first fruit in the list.Create a list
[1,2,3,4,5]. Check if 20 is not in the list, and print"Yes"if it’s not there or"No"if it is.Given the list
['a','b','c','d'], remove the last item and print the new list.Given the list
['a','b','c','d'], remove the first item and print the new list.Add a new element
'e'to the list['a','b','c','d']and print the updated list.Write a program that asks the user for two numbers and divides them, then prints the result.
Update the previous division program to handle errors using
try-exceptso it doesn’t crash if the user enters letters or divides by zero.Write a program that finds the remainder when one number is divided by another using the modulus operator
%.Explain the difference between a list and a set in Python. Give an example for each.
Given the list
['mr. tee','jason','ire','mishael','janet','mikayla','percy','jason','ire','mishael','janet'], replace the 4th element with'mary'and print the updated list.Convert the string
'9'into an integer using type conversion. Print the value and its type.
