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,
1 day ago
English,
1 day ago
India Languages,
2 days ago
Math,
2 days ago
Computer Science,
8 months ago
Math,
8 months ago