































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
































print("Hello, World!") Hello, World!
DataTypes Numeric Sequence Mapping Set Boolean Int, Float, Complex String, List, Tuples Dictionary (^) Set Bool
Code: String1 = 'Welcome to the Geeks World’ print("String with the use of Single Quotes: ") print(String1)print(type(String1))
Code: a = True Print(type(a)) b = False Print(type(b))
Code: set1 = set() print("Initial blank Set: ") print(set1) set1 = set("GeeksForGeeks") print("\nSet with the use of String: ") print(set1) set1 = set(["Geeks", "For", "Geeks"]) print("\nSet with the use of List: ") print(set1)set1 = set([1, 2, 'Geeks', 4, 'For', 6, 'Geeks’]) print("\nSet with the use of Mixed Values") print(set1)
Types Description Example Numeric Represents numerical values ‘int’, ‘float’, ‘complex’ Sequence Represents a collection of ordered and indexed value and sequence of Characters ‘str’, ‘list’, ‘tuple’ Set Represents a collection of unique elements ‘set’ Boolean Represents a binary truth value ‘bool’ Mapping Represents a collection of key-value pairs ‘dict’
Operators Arithmetic Assignment Comparison Logical Bitwise Identity Membership
x= y= print(x+y) print(x-y) print(x * y) print(x/y) print(x % y) print(x**y) print(x//y)
Operators Associativity () Left to Right ** Right to Left +x and -x Left to Right *,/,// and % Left to Right