Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Note that if you use any Python programming techniques beyond those covered in class, you must supply comments demonstrating that you understand how and why

image text in transcribed
image text in transcribed
Note that if you use any Python programming techniques beyond those covered in class, you must supply comments demonstrating that you understand how and why your code works as intended How to submit Your submission should consist of A commented source file that contains your name and your code. The comments should identify which code answers which question, and should provide any necessary explana- tion of the code's operation. All submissions must be submitted via UNM Learn. 1.1 Fizzbuzz (20 pts) In this question you will use implement the "Fizzbuzz" programming challenge. Write a function fizzbuzz that takes a single integer n as an argument and uses a loop, either a while or for loop, to print an output for each number from 1 up to an including n, according to the following rules: .if the number is divisible by 3 but not by 5, print "Fizz"; . if the number is divisible by 5 but not by 3, print "Buzz"; if the input value is divisible by both 3 and 5, print "FizzBuzz" (note this is one word on a single line); and .if the input value is not divisible by 3or5,print the numberf 1.2 Reversing lists (20 pts) In this question you will write several functions for reversing a list. In answering this question, you may not use the built-in Python functions reverse or reversed. a) (10 pts) Write a function reverseInPlace that takes as its argument a list and reverses that list in place. In other words, the function should not return a new list, and a variable that is bound to the list before the function call should be bound to the reversed list after the function returns. (b) (10 pts) Write a function reverseNeuList that takes as its argument a list and returns a new list that contains the same elements as the input list but in reverse order. 1.3 Palindrome (30 pts) A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as 'madam' or 'racecar' or the number '10801. You can use the following palindromes as a small limited test suite: Do Geese See God? Eva, Can I stab Bats in a Cave? .Was it a Rat I saw? You can NOT use the following string functions: reverse, or lower. (a) (20 pts) Write the program Palindrome as a function that takes a string as an argument and returns True if the string is a palindrome. Your function should remove uppercase, whitespace, as well as punctuation. (b) (5 pts) Output as a string the number of words in the string. (c) (5 pts) Output the count of letters in the string

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

=+4 Develop and deliver the CCT program.

Answered: 1 week ago

Question

=+5 Evaluate whether the CCT program was effective.

Answered: 1 week ago