Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
44 views
10 pages
Python Crash Course 1683722343
Uploaded by
Bruno Giordani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Python Crash Course 1683722343 For Later
Download
Save
Save Python Crash Course 1683722343 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
44 views
10 pages
Python Crash Course 1683722343
Uploaded by
Bruno Giordani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Python Crash Course 1683722343 For Later
Carousel Previous
Carousel Next
Download
Save
Save Python Crash Course 1683722343 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 10
Search
Fullscreen
# Running the Hello World Pmgram => Print (Hello Python World") Hello Python World ¥ Variables Variables are containers for Sorting data Values meesage = “Hello Python World” Paint (tmeasape) Hetlo Python world! & Strin 4 String isa Sequence of chavacterg Name = Ada Lovelace Print (name. upper) Print (name. tower C)) ADA LoveLAace Ada lovetaee a=% Combining or Concalenating Strings => © message =" Hello, "+ full name. tittec) +" 1" ® Print (message) & Numbers Integers: you can add (+) ,Substract (-) Thaltiply(t), and divide (/) integers in python. a 243 >>> 34 Fp >>> 243% 777 3-2 4 eK m 4 yy 3**3 Y>y(a43)*y rrr 3%, oF 20 6 te 3/2 2>> 10 *6 1a 1000000 4 What is 0 List? A List a Collection of items in a particular order, you can make a list that indudes the letters of the alphabet, the digit from 0-901 the name oF all tte People in cour family + you can pur anything you wont in o list.# Accessing Elements in O List bicycles = ("trek’, cannondale’ ‘redline’ ‘Specialised “J © Print Cbfoyctes fo) bi cycles =[‘krek’ cann ondale, Vedi", “Specialised” J Point (bicyeles [oJ title ()) F Index Positions bicycles =["trek’ camondale’® ‘vedlins!, ‘Specialized ] Print (bi oydes (13) Print (bicyctet [3]) motorcycles. oppend ( ducati’) Print (motorcycles) [honda’ ‘yamaha, ‘Suzuke ‘] f honda’, gamaha | Suzuki lucati’] * Removin det motorcyces (2) Print (matortycle} Fwiow. bepec-in{‘honda', ‘yamaha’ _ ‘Suuki?] C'honda’, ‘yamaha’ J * Popping Fitst owned = motorcycle . pop (0) Print (the first motorcycle T owned was a't fixek_ — Owned. titlec)+ '.*) The first motoycycle T owned was a tonda. 4 Removing an item by value motorcycles = [ao " ‘gamaha! Suzuki; ducati?) Print ( motoreyctes) motorcycles. vemove (ducati) Print (motoroydes) * Sovt cors = [“bmuo! , ‘audi’ * toyota’ , Subaru”) Cors . Sort (revers =True) Paint Ccars> 3) Se Btoyots''cubarw’,'biw’, ‘oudi’]+ Looping Omagician = [ alice’, david, Corofina ') @ fos magician in rnagictans ; ® Printing (magicians) * Using Range function for value in ranges C15): ao Fox value in vange (1,6): 4 Print (value) E 4 i 5 4 5 # Squares © Square =( J © fet lac in vange (4,44): ® re = value* *g © Squores. append. (square) © print CSquores) (1. 4,9 te, 25,36, 49, 614, Bt, too] erTuple ee ons = ’ for dimension in linear print (dimension) 200 50 & Lf Statement cors = Laud?’ ‘bmw’, Subiru, toyota] for car incars © if cr == ‘bmw’; Print (car. upper()) print (cor. title CD) Audi BMW Subisu Toyota. Checking whether a value is not ina tist banned_users = [andrew corolin’, david J users = marie® if user not in banned uSere: Print (usertitlet) +" qou con post a response if you . wish") & Voting age =(§ © if afe > =18 © — Priat (you are old enough to vote!) qyou are old enough to vote! fimusement Pork. (e afe 4: Print (“your admission cost is $0.) + Dictionary uStY_O = ‘username’ ‘eferm?’ “finst’ s “enrico’, ‘last’ s * 5 fermi’,WD tor Key Value In User_o. items¢): @ print ("\nkey + " +key) ® Print (“value: " 4 value) fork, V im USer_o. items C) > alien_o = {colour : 5 reer’, ‘points ‘s 54 alten.d = { ‘colous’ 2° yellow! , Points’: lof alien. 2 = { colour’ s * ved! ~ points’ 1154 ® aliens = Calien.o, alent, alten] for ahen in aliens: Print alien) {totowr 5 ‘Green, Paints” 254 { volour': “yellow: Points’: toy f cotour’ : “Red * Points : sy + Lrput function are = impukCplease enter your name: " Print (Hello, "+ names “1") F wa. bepee-i0]Ylease enter your name: Eric Hello, Erie | = Height = input (How tall are gov. in inch") height = int (height) it height > = 36 Print (“\nyoutre tall ermugh to vide") How tall ave you in inches $1 Youre Fall enough to vide! = while loops CurrenE number =41 while cuwent_ number 2=5: Print (curent_number) Current. number +=1 => pete [dog eat’, dog’, Goldsicn ‘nt’ rabbit’, at”) Print (pets) while ‘cat! in pets: Pets. remove (‘cat’) Print pets) asap yrunre# Defining a Function ® def Great_user(): @ “"" Display a Simple Breeling avo @ Print (Hetlo") ® Greet_userc ) Hetlo | => def make pizza C(“toppings) s "eink te list of toppings that have been requested." "" Print ( toppings) ‘make, piz3a ( "pepperont }) mane ~ pizza (Mushrooms Green peppers’ extra cheek) (' Pepperont ' > Crushrooms, ‘green peppert’‘extva. cheete’) ea
You might also like
LECTURE 5 Cheat Sheet Python
PDF
No ratings yet
LECTURE 5 Cheat Sheet Python
12 pages
Python Crash Course
PDF
No ratings yet
Python Crash Course
8 pages
Codeacademy Python
PDF
No ratings yet
Codeacademy Python
37 pages
Python Notes
PDF
No ratings yet
Python Notes
27 pages
Python
PDF
No ratings yet
Python
46 pages
python programming notes
PDF
No ratings yet
python programming notes
7 pages
Python For Data Science (Slideshare)
PDF
No ratings yet
Python For Data Science (Slideshare)
54 pages
Lap2 Eng
PDF
No ratings yet
Lap2 Eng
11 pages
Lab Manual
PDF
No ratings yet
Lab Manual
54 pages
Python Learinng Material
PDF
No ratings yet
Python Learinng Material
94 pages
Python Cheat Sheet PDF
PDF
No ratings yet
Python Cheat Sheet PDF
26 pages
Programming Python Workbook (1)
PDF
No ratings yet
Programming Python Workbook (1)
67 pages
Python
PDF
No ratings yet
Python
14 pages
Lab Task # 3 Introduction To Programming With Python
PDF
No ratings yet
Lab Task # 3 Introduction To Programming With Python
12 pages
Python
PDF
No ratings yet
Python
90 pages
1 Python
PDF
No ratings yet
1 Python
38 pages
Basics of Python
PDF
No ratings yet
Basics of Python
8 pages
Docsity Python Cheat Sheet For Beginner
PDF
No ratings yet
Docsity Python Cheat Sheet For Beginner
27 pages
Pychapt2 New
PDF
No ratings yet
Pychapt2 New
44 pages
Python
PDF
No ratings yet
Python
27 pages
Python Programming Notes
PDF
No ratings yet
Python Programming Notes
62 pages
keypycie1
PDF
No ratings yet
keypycie1
10 pages
Python Basics Warp Up
PDF
No ratings yet
Python Basics Warp Up
20 pages
Merged_Python_Programs
PDF
No ratings yet
Merged_Python_Programs
21 pages
Basic Python Program Examples
PDF
No ratings yet
Basic Python Program Examples
6 pages
CSE100_CSC101_CIS101 - Programming Problem Set.docx
PDF
No ratings yet
CSE100_CSC101_CIS101 - Programming Problem Set.docx
11 pages
Learning Python: From Zero To Hero: by TK
PDF
No ratings yet
Learning Python: From Zero To Hero: by TK
23 pages
Python Practice
PDF
No ratings yet
Python Practice
36 pages
Python Cheat Sheet: by Via
PDF
No ratings yet
Python Cheat Sheet: by Via
4 pages
Python Numpy Tutorial
PDF
No ratings yet
Python Numpy Tutorial
22 pages
Lecture Python Basics
PDF
No ratings yet
Lecture Python Basics
23 pages
Python Basic Data Types
PDF
No ratings yet
Python Basic Data Types
27 pages
4. PYTHON NOTES
PDF
No ratings yet
4. PYTHON NOTES
14 pages
Python Basics
PDF
No ratings yet
Python Basics
49 pages
A Short Course in Python For Astronomers
PDF
No ratings yet
A Short Course in Python For Astronomers
21 pages
Python Basics
PDF
100% (1)
Python Basics
75 pages
Python Notes
PDF
No ratings yet
Python Notes
141 pages
Python Jan 2025
PDF
No ratings yet
Python Jan 2025
23 pages
A Childrens Guide To Python Programming PDF
PDF
No ratings yet
A Childrens Guide To Python Programming PDF
10 pages
Python Cheatsheet Geetika
PDF
No ratings yet
Python Cheatsheet Geetika
26 pages
Day 3
PDF
No ratings yet
Day 3
23 pages
Python Codes
PDF
No ratings yet
Python Codes
37 pages
TalkFile_Chapter02. Strings, variables, input & output functions.pdf
PDF
No ratings yet
TalkFile_Chapter02. Strings, variables, input & output functions.pdf
21 pages
Python CheatSheet - Sahil
PDF
No ratings yet
Python CheatSheet - Sahil
8 pages
Digital Image Processing Lab Manual# 1
PDF
No ratings yet
Digital Image Processing Lab Manual# 1
9 pages
PwP
PDF
No ratings yet
PwP
19 pages
Tôi đang chia sẻ 'Python4AI Fundamentals (1)' với bạn
PDF
No ratings yet
Tôi đang chia sẻ 'Python4AI Fundamentals (1)' với bạn
29 pages
CS Practical
PDF
No ratings yet
CS Practical
74 pages
python basics
PDF
No ratings yet
python basics
13 pages
Python Cheatsheet Extracted
PDF
No ratings yet
Python Cheatsheet Extracted
7 pages
Overview of Python History of Python
PDF
No ratings yet
Overview of Python History of Python
15 pages
Python Learning Documentation
PDF
No ratings yet
Python Learning Documentation
23 pages
python1(1)
PDF
No ratings yet
python1(1)
87 pages
Python Basic
PDF
No ratings yet
Python Basic
18 pages
Python Unit1
PDF
No ratings yet
Python Unit1
24 pages
Python - And.c++.for - Beginners 08.december.2020
PDF
No ratings yet
Python - And.c++.for - Beginners 08.december.2020
80 pages
Python Cheat Sheet
PDF
No ratings yet
Python Cheat Sheet
59 pages
Basics
PDF
No ratings yet
Basics
6 pages