100 Days of Python - Udemy - Angela Yu Day 1
- Lecture 3 - contains links to course resources.
- Exercises on REPL.IT - Fork to modify and run the assignments.
- She recommends dark mode & large font on repl.it.
- Lecture 5 - Print
print ("Hello World!") # print to console
- stack overflow - Q & A for programmers
- Editor shows errors by color highlighting.
- Lecture Strings
- \n (backslash-n) puts line feed in a string
print ("Hello world! In Hello World!")
Hello world!
Hello World!
- Concatenate strings by + sign.
print ("Hello"+ Angela")
- Indentation critical in Python
- Turn on code intelligence in repl.it settings shows errors as you're editing your program
- Lecture 9 Input statement
name=input("What is your name?")
print ("Hello " + input(" what is your name?"))
- She likes the debug feature of Thonny
- Comments are preceded by # in Python
- ctrl+/ comments the line of code you're on or the highlighted lines of code.
- Variables
- Variable names should be meaningful
- user_name
- variable name can't start with a number
- don't use reserved words. Like print & input
- Variable names are case sensitive
- Data Types
- String, Integer, Float, Boolean
- STRING[int] - Gets nth char of a string
- In #'s you can put underscores where commas might go
- 1,234,567 --> 1_234_567
- Boolean True or False
- Can't concatenate int to string:
Print ("Your Name has " + str(len(name)) + " characters")
- converts integer or float to string
udemy
angelayu
python