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
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
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
Math,
18 days ago
India Languages,
1 month ago
Math,
1 month ago
Computer Science,
9 months ago
Math,
9 months ago