2.9 KiB
learning python
Python #1:
ex0
ex1
>>> print("Hello World!") … print("Hello Again") … print("I like typing this.") … print("This is fun.") … print('Yay! Printing.') … print("I'd much rather you 'not'.") … print('I "said" do not touch this.') Hello World! Hello Again I like typing this. This is fun. Yay! Printing. I'd much rather you 'not'. I "said" do not touch this.
ex2
I could have code like this. This will run.
ex3
I will now count my chickens : Hens 30.0 Roosters 97 Now I will count the eggs : 6.75 Is it true that 3 + 2 < 5 - 7? False What is 3 + 2? 5 What is 5 - 7? -2 Oh, that;s why it's Fasle. How about some more. Is it greater? True Is it greater or equal? True Is it less or equal? False
ex4
There are 100 cars available. There are only 30 drivers available. There will be 70 empty cars today. We can transport 120.0 people today. We have 90 to carpool today. We need to put about 3.0 in each car.
ex5
Let's talk about Zed A. Shaw. He's 74 inches tall. He's 180 pounds heavy. Actually that's not too heavy. He's got Blue eyes and Brown hair. His teeth are usually White depending on the coffee. If I add 35, 74, and 180 I get 289.
ex6
There are 10 types of people. Those who know binary and those who don't. I said: There are 10 types of people. I also said: 'Those who know binary and those who don't.' Isn't that joke so funny?! False This is the left side of…a string with a right side.
ex7
Mary had a little lamb. Its fleece was white as snow. And everywhere that Mary went. ………. Cheese Burger
Python #2:
ex8
learn about a more complicated formatting of a string. {}
ex9
how to print for multiline or nextline
ex10
how to use \ (using special chracter)
ex11
how to use key input
ex12
how to use key input with print
ex13
how to use an argument when you run script
ex14
how to use an argument with input
Python #3:
ex15
How to use read function from file
ex16
How to write file
ex17
How to copy file
ex18
How to use function
ex19
How to use function and variables
ex20
How to use function with file
ex21
How to use fucntion with return
ex22
repeat from ex1 to ex21 " # () ' + . < ? , = / % - * {} \n \t open read close truncate def return print
Python #4:
ex23
How to use encode and decode
ex24
practice function and print
ex25
practice import function
ex26
practice debug code
Python #5:
ex27
How to use True and Flase
ex28
How to use Boolean
ex29
How to use if-statement
ex30
How to use if-else
ex31
How to use if, elif
Python #6
ex32
How to use for-loop append, insert, extend, copy, remove, pop, clear, count, index, reverse, sort
ex33
How to use while-loop
ex34
How to use Accessing Elements of Lists
ex35
practice function, while, if
ex36
some rules of if, loop and tips for debugging