Must Know High School Computer Programming by Julie Sway
Author:Julie Sway
Language: eng
Format: epub
Publisher: McGraw-Hill Education
Published: 2020-02-01T16:00:00+00:00
8. Create a list of five of your favorite songs.
Process the list using a for loop.
Print the song titles that have an even number of letters in the
song name.
At the end of the loop, print “Play it again!”
9. The Fibonacci sequence is a well-known series where a number is the sum of the two numbers preceding it. For example: 8 is the sum of 3 + 5.
fibonacci = [0, 1, 1, 2, 3, 5, 8, 13]
a. Append the next two values in the Fibonacci series to the list.
b. Print your Fibonacci list to confirm the values.
10. How would you write the code to insert “John Quincy Adams” after “Monroe” and print the list, roster? roster = [“Washington”, “Adams”, “Jefferson”, “Madison”, “Monroe”, “Jackson”, “Van Buren”]
Use this list for the following three questions. How would you write the following lines of code? Remember to test your code in Python to confirm your answer.
pets = [“dog”, “cat”, “bird”, “turtle”,
“horse”, “fish”, “snake”]
11. Write the line of code to remove “horse” from the list of pets.
12. Write the code to remove the current 4th element from the list.
13. Write the code to delete “snake” from the list.
Use the following list for questions 14-18.
14. Write the code to find and print the largest number in the list weights?
weights = [2, 4, 6, 7.5, 9.8, 42, 19]
What is produced after each of the following blocks of code?
weights = [2, 4, 6, 7.5, 9.8, 42, 19]
15. print(sum(weights))
16. print(sum(weights) * 2)
17. print(sum(weights) / 2)
18. print(sum(weights) - 2)
19. What is printed after the following lines of code?
nums = [42, 256, 1023]
print(nums * 3)
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12571)
Hello! Python by Anthony Briggs(9916)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9796)
The Mikado Method by Ola Ellnestam Daniel Brolund(9779)
Dependency Injection in .NET by Mark Seemann(9340)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8298)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7076)
Microservices with Go by Alexander Shuiskov(6843)
Practical Design Patterns for Java Developers by Miroslav Wengner(6764)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6703)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6414)
Angular Projects - Third Edition by Aristeidis Bampakos(6108)
The Art of Crafting User Stories by The Art of Crafting User Stories(5638)
NetSuite for Consultants - Second Edition by Peter Ries(5570)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5375)
Kotlin in Action by Dmitry Jemerov(5063)
