83.1k views
5 votes
Write a function contains_at() that accepts two sequences (e.g., lists, strings, etc), s and q, and an integer p

User Supertux
by
5.7k points

1 Answer

3 votes

Answer:

Following are the method to this question:

def contains_at (s, q, p):#defining a method contains_at that accepts a list string and an integer.

Step-by-step explanation:

In the above-given question, some of the data missing, that's why we define this question as follows:

program for the above the given method:

def contains_at (s, q, p):#defining a method contains_at

return s,q,p #use return keyword to return parameter value

s="data base"#defining string variable

q=[1,2,3,4,5]#defining a list

p=3#defining integer variable

print(contains_at(s,q,p))#use print method to call contains_at method

Output:

('data base', [1, 2, 3, 4, 5], 3)

In the above program, a method contains_at is declared, which accepts a list, string, and an integer value in its parameters, and use the return keyword to return the above parameter value.

In the next step, a parameter variable is declared, which accepts a value, and use a print method to call the method.

User Ryman Holmes
by
5.6k points