catherine51 catherine51
  • 28-01-2022
  • Computers and Technology
contestada

Learning python and am confused on how to code this problem in order for the function to return these statements... please help!

Learning python and am confused on how to code this problem in order for the function to return these statements please help class=

Respuesta :

tonb
tonb tonb
  • 28-01-2022

Answer:

def k_in_num(k, num):

 if (k == 0): return False

 return str(k) in str(num)

Explanation:

A bit weird that 0 doesn't contain 0, but anyway, above code does what you want.

Answer Link

Otras preguntas

What Is the War Powers Act?
How do I write 0.45 as a reduce Fraction??
which birds build their nests in tall trees?
what were the results of Spanish and Portuguese conquests in the americas
Which equation can be used to find the perimeter of a regular hexagon with sides of length 14 inchesA. P=6(14)B.P=6+14C.P=14 DIVIDED BY 6D.P=2(6)+2(14)
The molar heat of fusion of gold is 12.550 kJ mol–1. At its melting point, how much mass of melted gold must solidify to release 235.0 kJ of energy?
how is the number of lines of symmetry for a regular polygon connected to the number of sides of the polygon
a fraction that has been rewritten to have the smallest possible numerators and denominator is in      form
If 1/2 x 10 = 8 -x, then x = ____
How can you multiply a mixed number