Get help from the best in academic writing.

Stacks and Palindromes

Stacks and Palindromes.

beginner python Homework

Lab 2 Answer Template Name : _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

First Last

Exercise 1: Stacks and Palindromes (2 points)

a. Adjust demo2() so the user can enter a putative palindrome at the keyboard using raw_input(“Enter a phase: “).upper()

Show the output of your program when the user enters: 
A nut for a can of tuna.

b. Show your completed code for the __eq__ magic method.

def __eq__(self, other):

# add code here.
Exercise 2: Some Magic Methods for Lists (2 points)
Paste in your output for examples 6 to 10. Your TA will randomly pick two to grade.
Exercise 3: Callable Objects (2 points)
a. Paste in your completed code for example 8.

def example8():

# add code here.
b. Paste in your completed code for example 9.

Save your time – order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

def example9():

# add code here.
Exercise 4. HanoiStacks
Complete the last two steps to solve the Tower of Hanoi with N=3.
a. Paste in your code for move #6.
b. Paste in your code for move #7.
Exercise 5. Towers of Hanoi
Paste in your completed main method. One point for detecting the half-way point and one point for printing out the number of moves.

def example9():

# add code here.

Stacks and Palindromes

Leave a Comment

Your email address will not be published. Required fields are marked *