Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Python Programming: Exploring the Fundamentals, Summaries of Computer Fundamentals

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

2023/2024

Available from 10/02/2024

deepanshu-bahuguna
deepanshu-bahuguna 🇮🇳

4 documents

1 / 39

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Python Programming
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27

Partial preview of the text

Download Python Programming: Exploring the Fundamentals and more Summaries Computer Fundamentals in PDF only on Docsity!

Python Programming

Definition

 Python is an interpreted, object-oriented, high-level programming

language that is widely used in various fields including data science,

web development and artificial intelligence(AI).

Features Of Python

  • (^) Free and Open Source
  • (^) Portable language
  • (^) Interpreted Language
  • (^) GUI Programming Support
  • (^) High-Level Language

Application of Python

  • (^) Web Development
  • (^) Machine Learning and Artificial Intelligence
  • (^) Data Science
  • (^) Game Development
  • (^) Audio and Visual Application
  • (^) Software Development

Interactive mode

  • (^) Interactive mode allows you to run Python commands individually in a shell or a Python prompt. The Python shell is invoked by typing python or python3 in your terminal or command line without specifying a script.
  • (^) When you enter interactive mode, you can type Python expressions, and the interpreter immediately executes them and gives feedback.
  • (^) Example – $ python

print("Hello, World!") Hello, World!

DataTypes Numeric Sequence Mapping Set Boolean Int, Float, Complex String, List, Tuples Dictionary (^) Set Bool

Sequence (String)

Code: String1 = 'Welcome to the Geeks World’ print("String with the use of Single Quotes: ") print(String1)print(type(String1))

Sequence(List)

Code:

List = []

print("Initial blank List: ")

print(List)

List = ['GeeksForGeeks’]

print("\nList with the use of String: ")

print(List)List = ["Geeks", "For", "Geeks"]

print("\nList containing multiple values: ")

print(List[0])

print(List[2])

List = [['Geeks', 'For'], ['Geeks’]]

print("\nMulti-Dimensional List: ")

print(List)

Boolean

Code: a = True Print(type(a)) b = False Print(type(b))

Set

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)

Recap….

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

Code:

x= y= print(x+y) print(x-y) print(x * y) print(x/y) print(x % y) print(x**y) print(x//y)

Precedence & Associativity

Operators Associativity () Left to Right ** Right to Left +x and -x Left to Right *,/,// and % Left to Right

  • and - Left to Right