8 Ways to Optimize AWS Glue Jobs in a Nutshell
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpbyr5vaujY6qi94k0UMk1s7PI9ugsl4tgSR8S6P1B5p4Me9-Ncb7GEc75ESogTcjC1XNccHnNni6TWdgr9xWeOq2PkTfTSnEBCSa6lAleJFCUJ5LpkxHUtI7GoH-d2S4Gkz8_X6shYplNcPHAmOBDw4yS6GcJJ2oVLOJaTBHjRxfyM_RLaE9z4EZzjFeK/w320-h180/How%20to%20Optimize%20AWS%20Glue%20Jobs.jpg)
Python program:
#Prints all the Set items
food = {"pasta", "burger", "hot dog", "pizza"}
print(food)
# Prints the Set items without pasta
food.discard("pasta")
print(food)
# Prints the Set items without burger and pasta
food.remove("burger")
print(food)
# The next two lines try to remove an item that isn't in the set!
food.discard("pasta") # this will not report an error
food.remove("pasta") # this will report an error
The output:
{'pasta', 'burger', 'pizza', 'hot dog'}
{'burger', 'pizza', 'hot dog'}
{'pizza', 'hot dog'}
Traceback (most recent call last):
File "main.py", line 12, in <module>
food.remove("pasta") # this will report an error
KeyError: 'pasta'
** Process exited - Return Code: 1 **
Press Enter to exit terminal
Related
Comments
Post a Comment
Thanks for your message. We will get back you.