Chapter 11 exercise 1 : Python tutorial 143

preview_player
Показать описание
Guys please help this channel to reach 20,000 subscribers. I'll keep uploading quality content for you.

Python is easy programming language to learn and anyone can learn it, and these tutorials are 100% free in hindi.

You can share this playlist with your brother, sisters and friends. This will surely add some values to their life.

If you follow this complete playlist of python tutorial surely you will learn everything about python programming language.

This exercise 1 of chapter 11

Рекомендации по теме
Комментарии
Автор

Bhaiya really jo topic mam kyi lecture me clear nhi kar paati aap 5-10 min me kr dete ho 🙂
Thankx a lot ❣️

DJverma
Автор

this Playlist is really cool 😎 😎 this Playlist cover all the topics

Zeus_og
Автор

def cube_nums(a, *args):
l=[i**a if args else print("you did not entered any number ") for i in args ]
return l
print(cube_nums(2, 2, 5))

sparshsharma
Автор

Sir! here is my solution:
def num_power (num, *args):
if args:
return [int(i)**num for i in args]
else:
return('hey you did\'t pass args')
nums = [1, 2, 3]
print(num_power(3, *nums))

zeeshanakram
Автор

Radhe Present sir,


My Solution:

def fun(power,  *args):
    result=[]
    if args:
        for i in args:

    else:

    return result


print(fun(3, *[1, 2, 3, 4]))
print(fun(2))

tarunsukhpalani
Автор

def multiply(num, *arg):
if arg == ('', ):
print('Hey you did not enter anything')
else:
l = [int(i)**num for i in arg]
print(l)
num = int(input('Please enter a number'))
nums = []
nums = input("Please enter number into the list seperated by comma's:").split(", ")
multiply(num, *nums)




Best one till date

royalenfieldmeteorrider
Автор

def to_power(a, *args):
lst=[]
if len(args)==0:
print("Hey you didnt pass args")
exit()
else:
for i in args:
lst.append(i**a)
return lst

print(to_power(2, 1, 2, 3, 4, 5))

hadiyaahsan
Автор

def power_cal(num, *args):
if(len(args) >0):
lst = [j**num for j in args]
return lst
else:
return ("Please pass numbers in args")

muzik
Автор

def cube_with_con(num, *args):
if args:
return [i**3 for i in args]
else:
return("you didnot pass any argument !")

num=[1, 2, 3, 4, 5, 6]
print(cube_with_con(3))

sadiqshah
Автор

def to_power(power, *args):
if len(args) == 0:
return "Hey! you did not pass args"
return [num ** power for num in args]

siddharthmalviya
Автор

here's my solution:
#Exercise 1:
def power(num, *args):
if len(args) == 0:
return "Hey! You didn't pass args"
else:
ans = [i**num for i in args]
return ans

l = [1, 2, 3, 4, 5]
print(power(3, *l))

mariumsaleem
Автор

num = int(input("Enter the number: "))
def power(num, *args):
if args:
return [i**num for i in args]
else:
print("Yoy haven't enter the number")
l=[]
print(power(num, *l))

rajeshprajapati
Автор

Thnaks ! Keep doing this hard and excellent work...

deveshkumar
Автор

Solution :
def to_power(num, *args):
temp_list = []
if (args == ()):
return ("Please input args")
else:
for i in args:
temp_list.append(i**num)
return (temp_list)

print(to_power(3, 1, 2, 3, 4))

NoorMuhammad-dtkf
Автор

def func(e, *args):
if len(args) == 0:
return "You didn't pass any Arguments."
India = [i**e for i in args]
return India

Bangladesh = [1, 2, 3, 4]
#Bangladesh.clear()
print(func(2, *Bangladesh))

shamimsarker
Автор

def my_power(number, *args):
list1 = [i**number for i in args]
return list1


power = int(input("enter a number: "))
size = int(input("enter the size of your list: "))
my_list = []
for i in range(size):
element = int(input(f"enter the {i}th element: "))
my_list.append(element)
print(f"the list created is: {my_list}")
print(my_power(power, *my_list))

hikikomori
Автор

Isn't this code correct-
def calculate_power(num, *args):
return([i**num if args else ' hey you
didn't pass any args ])
nums=[2, 3, 4]
print(calculate_power(3, *num))

tejveermakhloga
Автор

num = input("Enter the Number : ")
if not num.isdigit():
print(f"{num} Not an int")
else:
num = int(num)
lst = input("Enter Your list : ").split(", ")
lst = [int(i) if i.isdigit() else print(f"{i}is not int") for i in lst]
final_lst = [i ** num for i in lst]
print(final_lst)

supratimpathak
Автор

def power(n, *args):
if args == tuple():
return "you didn't passed args :( "
else :
new_list = [int(i)**n for i in args]
return new_list
l = list(input('enter a list : ').split(", "))
n = int(input("enter a num for eponent : "))
print(power(n, *l))

mohanbarman