Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Study Questions
#1
Define a function unique_elem takes two strings str_1 and str_2 as inputs and prints
only the elements that occur in str_1 and not in str_2. Note: You are NOT allowed to
use the in operator.
>> unique_elem(“hello”, “hola”)
e
>> unique_elem(“alyo”, “efendim”)
a
l
y
o

3. Define a function string_reverse that takes a string as input and returns a reversed
version of it.
>> print string_reverse(“sehir”)
rihes

4. Define a function repeat_letters that takes a string and a number n as its two inputs and
prints the string with every letter repeated n times.
>>print repeat_letters(“bla”, 2)
“bbllaa”

pls help me
Reply


Messages In This Thread
Study Questions - by captainflint - Jan-31-2018, 03:09 PM
RE: Study Questions - by j.crater - Jan-31-2018, 04:09 PM
RE: Study Questions - by sparkz_alot - Jan-31-2018, 09:24 PM
RE: Study Questions - by captainflint - Feb-01-2018, 11:16 AM
RE: Study Questions - by Mekire - Feb-01-2018, 12:45 PM
RE: Study Questions - by captainflint - Feb-01-2018, 03:11 PM
RE: Study Questions - by gruntfutuk - Feb-01-2018, 06:01 PM
RE: Study Questions - by captainflint - Feb-02-2018, 12:27 PM
RE: Study Questions - by DeaD_EyE - Feb-02-2018, 12:55 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020