Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using python, Template: #PROBLEM 1 def addOne(l1): list1 = l1 return 0 #YOUR CODE GOES HERE (indented) return l1 #END YOUR CODE #PROBLEM 2 def

Using python,

Template:

#PROBLEM 1 def addOne(l1): list1 = l1 return 0 #YOUR CODE GOES HERE (indented) return l1 #END YOUR CODE #PROBLEM 2 def checkIn(l1,l2): string1 = l1 string2 = l2 #YOUR CODE GOES HERE (indented) return string1 #END YOUR CODE

Problem 1: Write code that adds 1 to every element in a list. For example, the list [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] would yield [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]. You may not use any built-in functions/methods besides len() and .append().
Problem 2: Write code that takes two strings from the user, and sees if all the letters in the second string appear in the first, in order. For example, happybirthday and apt yields the result True, while happybirthday and htb yields the result False.

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

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions

Question

Question How are IRAs treated for state tax law purposes?

Answered: 1 week ago