O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

Chapter 0 Python Overview (Python Programming Lecture)

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Carregando em…3
×

Confira estes a seguir

1 de 69 Anúncio

Chapter 0 Python Overview (Python Programming Lecture)

Python Programming Course Lecture by IoT Code Lab Training.
Discussed Topic:
Chapter 0: Python Overview
0. Python Introduction
1. What is Python?
2. Story of Python
3. Why Python
4. Use of Python
5. Python Download + Installation
6. How to Use? + Online Course Resource
1. Variable, Data Type, Expression
1. Create First Python Program File
2. First Program - Hello World
3. Comment
4. Variable + Data Type + Example
5. Variable Naming Convention
6. Practice 0.1
2. Input/ Output
1. Input/ Output (String)
1. A String Input & Output
2. Display A Message in Print & Input function
3. Check Data Type
4. Practice 0.2
2. Input/ Output (Number)
1. An Integer Number Input & Output + Check Data Type
2. Type Conversion
3. A Float Number Input & Output + Check Data Type
4. Built-in Function with Example
5. Practice 0.3
3. Formatted Input Output

Python Programming Course Lecture by IoT Code Lab Training.
Discussed Topic:
Chapter 0: Python Overview
0. Python Introduction
1. What is Python?
2. Story of Python
3. Why Python
4. Use of Python
5. Python Download + Installation
6. How to Use? + Online Course Resource
1. Variable, Data Type, Expression
1. Create First Python Program File
2. First Program - Hello World
3. Comment
4. Variable + Data Type + Example
5. Variable Naming Convention
6. Practice 0.1
2. Input/ Output
1. Input/ Output (String)
1. A String Input & Output
2. Display A Message in Print & Input function
3. Check Data Type
4. Practice 0.2
2. Input/ Output (Number)
1. An Integer Number Input & Output + Check Data Type
2. Type Conversion
3. A Float Number Input & Output + Check Data Type
4. Built-in Function with Example
5. Practice 0.3
3. Formatted Input Output

Anúncio
Anúncio

Mais Conteúdo rRelacionado

Diapositivos para si (20)

Semelhante a Chapter 0 Python Overview (Python Programming Lecture) (20)

Anúncio

Mais recentes (20)

Anúncio

Chapter 0 Python Overview (Python Programming Lecture)

  1. 1. PYTHON PROGRAMMING Chapter 0 Python Overview
  2. 2. Topic • Python Introduction • What is Python? • Story of Python • Why Python • Use of Python • Python Download + Installation • How to Use? + Online Course Resource • First Program - Hello World • Comment • Variable + Data Type • Variable Naming Convention • Input/ Output • Type Casting • Built in Function
  3. 3. PYTHON PROGRAMMING Chapter 0 Lecture 0.0 Python Introduction
  4. 4. Python – What is? • Object Oriented • High Level • General Purpose Programming Language • Interpreted • Dynamic Semantics
  5. 5. Python – Story • Created by Guido van Rossum • The name Python was inspired by the BBC TV show Monty Python's Flying Circus • Implementation began in December 1989 • Initial Release (labeled version 0.9.0) => 20 February 1991 • Python 1.0 => January 1994 • Python 2.0 => 16 October 2000 • Python 3.0 => 3 December 2008
  6. 6. Python – Why? • Easy to learn • Open source • One of the most influential programming languages
  7. 7. Python - Use • Scientific and Numeric analysis • Web Development • Desktop GUIs • Data Science • Artificial Intelligence • Machine Learning • Data Analysis • Data Visualization
  8. 8. Python – Download
  9. 9. Python – Installation
  10. 10. Python – Installation
  11. 11. Python – Installation Page 2
  12. 12. Python – Installation Page 3
  13. 13. Python – After Installation
  14. 14. Python – Installation – IDE Interface
  15. 15. Python – Installation – IDE Interface
  16. 16. Python – Installation – IDE Interface
  17. 17. Python – Installation – IDE Interface
  18. 18. Python – Installation – IDE Interface
  19. 19. Any Question? Like, Comment, Share Subscribe
  20. 20. PYTHON PROGRAMMING Chapter 0 Lecture 0.1 Variable, Data Type, Expression
  21. 21. Create First Python Program File • Python IDLE • File -> New File -> Save (/Save As) -> Hello.py • Write Python Program • Run -> Run Module (/F5)
  22. 22. Write First Python Program print("Hello World")
  23. 23. Comment # Single Line Comment """ Multi Line Comment """
  24. 24. First Python Program Modified 1 # First Python Program # Program Name: Hello World # Author Name: Mun Al Mamun # A Program to Print a text print("Hello World")
  25. 25. First Python Program Modified 2 """ First Python Program Program Name: Hello World Author Name: Mun Al Mamun A Program to Print a text """ print("Hello World")
  26. 26. Variable • Symbolic name to store date in computer program
  27. 27. Data Type • Integer => 0, 2, 20038, -332 • Float => 5.5, 3.1416, -40.56 • String => Hello World, This is 2019 • Boolean => True, False
  28. 28. Variable (Integer) # Integer Variable my_roll = 50 print(my_roll)
  29. 29. Variable (Integer) + Data Type # Integer Variable with Data Type my_roll = 50 print(my_roll) print(type(my_roll))
  30. 30. Variable (Float) + Data Type # Float Variable with Data Type my_gpa = 4.5 print(my_gpa) print(type(my_gpa))
  31. 31. Variable (String) + Data Type # String Variable with Data Type my_name = "My Name is Mun" print(my_name) print(type(my_name))
  32. 32. Variable (Boolean) + Data Type # Boolean Variable with Data Type test = True print(test) print(type(test))
  33. 33. Variable (Boolean) + Data Type [2] # Boolean Variable with Data Type test = False print(test) print(type(test))
  34. 34. NoneType # NoneType Variable with Data Type value = None print(value) print(type(value))
  35. 35. Data Type • str (String) • int (Integer) • float (Float) • bool (Boolean) • None (NoneType)
  36. 36. Variable Naming Convention • Must begin with a letter (a - z, A - B) or underscore (_) • Other characters can be letters, numbers or _ • Variable names are case-sensitive • Variables should be all lowercase • Words in a variable name should be separated by an underscore • Don't start name with a digit. • Never use special symbols like !, @, #, $, % • Reserved words cannot be used as a variable https://visualgit.readthedocs.io/en/latest/pages/naming_convention.html
  37. 37. Practice Problem 0.1 1. Declare a Integer variable and print value with data type 2. Declare a Float variable and print value with data type 3. Declare a String variable and print value with data type 4. Declare a Boolean variable and print value with data type 5. Declare a NoneType variable and print value with data type
  38. 38. Any Question? Like, Comment, Share Subscribe
  39. 39. PYTHON PROGRAMMING Chapter 0 Lecture 0.2.1 Input Output (String)
  40. 40. Input/Output 1 # input a String name = input() print(name)
  41. 41. Input/Output 1 (Con.)[Display Message 1] #input a String print("Input Your Name") name = input() print(name)
  42. 42. Input/Output 1 (Con.)[Display Message 2] #input a String name = input("Input Your Name: ") print(name)
  43. 43. Input/Output + Data Type #input a String name = input("Input Your Name: ") print(name) print(type(name))
  44. 44. Input Your Name # Solution 1: # input a String and Display the String name = input() print(name) # Solution 2: # input a String with Message in print() print("Input Your Name") name = input() print(name) # Solution 3: # input a String with Message in input() name = input("Input Your Name: ") print(name) # Solution 4: #input a String and Know Datatype name = input("Input Your Name: ") print(name) print(type(name))
  45. 45. Practice Problem 0.2 1. Input your Name and print the value 2. Input your Name with a massage and print the value 3. Input your Name with a massage in input() function and print the value 4. Input your Name with a massage in input() function and print the value with data type
  46. 46. Any Question? Like, Comment, Share Subscribe
  47. 47. PYTHON PROGRAMMING Chapter 0 Lecture 0.2.2 Input Output (Number)
  48. 48. Input an Integer Number age = input() print(age)
  49. 49. Input an Integer Number [Con.][Data Type] age = input() print(age) print(type(age)) • All Input is String in Python • We have to Type Cast to convert String into Integer.
  50. 50. Input an Integer Number (*) age = input() print(age) print(type(age)) # Type Cast to Integer Number age = int(age) print(age) print(type(age))
  51. 51. Input an Integer Number [Final] age = int(input()) print(age) print(type(age))
  52. 52. Input an Float Number gpa = input() print(gpa) print(type(gpa))
  53. 53. Input an Float Number (*) gpa = input() print(gpa) print(type(gpa)) # Type Cast to Float Number gpa = float(gpa) print(type(gpa)) print(gpa)
  54. 54. Input an Float Number [Final] gpa = float(input()) print(gpa) print(type(gpa))
  55. 55. Built-in Function • print() • input() • type() • int() • float()
  56. 56. Built-in Function source: https://docs.python.org/3.6/library/functions.html
  57. 57. Practice Problem 0.3 1. Input your age and print data with type (Be sure about type conversion to integer) 2. Input your gpa and print data with type (Be sure about type conversion to float)
  58. 58. Any Question? Like, Comment, Share Subscribe
  59. 59. PYTHON PROGRAMMING Chapter 0 Lecture 0.2.3 Formatted Input Output
  60. 60. Formatted I/O name = input("What is Your Name: ") print("Hello,", name) roll = int(input("What is Your Roll: ")) print("Your roll is:", roll) gpa = float(input("What is Your GPA: ")) print("Your GPA is", gpa)
  61. 61. Formatted I/O 2 name = input("What is Your Name: ") roll = int(input("What is Your Roll: ")) gpa = float(input("What is Your GPA: ")) print(name,roll,gpa)
  62. 62. Formatted I/O 3 #Input Name with Formatted Output name = input("What is Your Name: ") 1. print("Hello,",name) 2. print("Hello,", name, "How are You", name, "?") 3. print("Hello,", name, "nHow are You", name, "?") 4. print("Hello, {}nHow are You {}?".format(name,name)) 5. print(f"Hello, {name}nHow are You {name}?")
  63. 63. Any Question? Like, Comment, Share Subscribe

×