Advertisement
dprincef

Untitled

Mar 7th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. def plenty_of_arguments(a,b,**kwargs,): #Declares a function that accepts a parameter a and b and kwargs
  2.     g = [] #An emptyblist that stores the value of any a or b inputted
  3.     g.append(a) #appends the value of a to g
  4.     g.append(b) #appends the value of b to g
  5.    
  6.     if sum(g) > 100: #checks if the sum of a and   is greater than 100 and prints true if the condition is true
  7.         print("True")
  8.     elif sum(kwargs.values()) > 100: #checks if the sum of the values of the dictionary is greater than 100 and prints rue if the condition is correct
  9.         print("True")
  10.     else: #Else False is thre output
  11.         print("False")
  12. plenty_of_arguments(50,60) #Calls the plenty_of_arguments function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement