Question: These are all questions relating to python computerprogramming 21. What does immutable mean in the context of programming? 22. What is a list in Python?
These are all questions relating to python computerprogramming
21. What does immutable mean in the context of programming?
22. What is a list in Python?
23. What is a tuple in Python?
24. When do you choose a list over a tuple?
25. How do you get the last value in a list or a tuple?
26. What is Index Out Of Range Error?
27. Why should a program close a file when it is finished usingit?
28. Assume the names variable references a list of strings.Write code that determines whether 'Dale' is in the names list. Ifit is, display the message 'Hello Dale'. Otherwise, displaythe message 'No Dale'.
29. Write a program that opens a specified text file thendisplays a list of all the unique words found in the file. Hint:Store each word as an element of a set.
30. Write a program that reads the contents of a text file. Theprogram should create a dictionary in which the keys are theindividual words found in the file and the values are the number oftimes each word appears. For example, if the word "the" appears 128times, the dictionary would contain an element with 'the' as thekey and 128 as the value. The program should either display thefrequency of each word or create a second file containing a list ofeach word and its frequency.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
