































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A comprehensive overview of python programming, covering its definition, features, and applications. It delves into the key differences between python and c++, highlighting the advantages of python's interpreted nature, dynamic typing, and extensive standard library. Various data types in python, including numeric, sequence, mapping, set, and boolean, and showcases examples of their usage. It also introduces the concept of operators in python, covering arithmetic, assignment, comparison, logical, bitwise, identity, and membership operators. Additionally, the document discusses conditional statements, such as if-else and nested if-else, demonstrating their practical applications. This resource is designed to serve as a valuable reference for students and professionals interested in understanding the fundamentals of python programming.
Typology: Summaries
1 / 39
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