Computer Science, asked by snehalambigar061, 1 month ago

if input_ num is lesser than the first element of the input_ list then initialize the output_ num with double the value of input_num pythonnprogram​

Answers

Answered by saransrini03
3

lst = [6,5,4,3,2,12]

# number of elements as input

n = int(input("Enter number of elements : "))

if n < lst:

  print(n*n)

   

Answered by SyedAzar
1

Answer:

def result(input_num)

    if input_num < input_list[0]     #denotes first index position of the input_list

         output_num = 2 * input_num

         return output_num

input_list=[2,4,6,8,10]

print(result(n))                               #n denotes input_num

Explanation:

Similar questions