Python Input in List

Hello Mam @Divya i have one daut realted to assignemt question can i ask lots of confusion happeing in my mind

2 Likes

Drop your query @harshdip1804

@harshdip1804
Yes, write here your query.

Write a Python program to triple all numbers of a given list of integers. Use Python map.
sample list: [1, 2, 3, 4, 5, 6, 7]
Triple of list numbers:
[3, 6, 9, 12, 15, 18, 21]
and another question
Write a Python program to square the elements of a list using map() function.
Sample List: [4, 5, 2, 9]
Square the elements of the list:
[16, 25, 4, 81]

both the question we need take input from user right and input will be in a list
so
sample_list = list(map(int,input(“Enter the list of numbers that u want :”).split(“,”)))
this is right ?

1 Like

yes correct @harshdip1804

1 Like

Ok Thank You… :+1: :+1: :+1: :+1: :+1:

1 Like