Python Classroom Notes – 16/April/2024

Different Types of Applications

  • Standalone Applications and Client Side Applications
    • Command line Applications
    • Desktop Applications
    • Mobile Apps
  • Server Side Applications
    • Web Applications
    • Web APIs
  • Integrations
    • Message Queues
    • Pub sub

Scope of our discussion in Python

  • Writing logic
  • Building CLI and APIs in Python
  • Leverage cloud to build decent applications (Serverless)
  • Persistence using
    • Relational Databases
    • NOSQL Databases
  • Integrations

Story of our Programming journey

  • Our Friend Ishika

Introduction of our communication

  • Ishika can remember values, but you have to tell to remember by giving a name and value
Remeber hyderabad with alias/name city
  • Ishika knows how to

    • add +
    • mul *
    • sub –
    • divide /
    • remainder (modulus) %
  • To make ishika add numbers

Hi ishika
Remeber 2 as num1
Remember 4 as num2
add num1 adn num2 and tell me result
  • Ishika executes what you said sentence by sentence

  • Lets make ishika multiply numbers

Hi ishika
Remeber 2 as num1

Add num1, num1 and remember result 
Add result, num1 and remember result
  • Lets try to make ishika tell if the number is even or odd (+ – * / %)
Remeber 21 as number
perform number % 2 and store result
if result is zero say even else odd
  • Lets add sum of all numbers 369 => 3 + 6 + 9. Ishika knows + - * / %
Hi ishika
Remember 369 as number
calculate number % 10 and store in value1  (369%10 = 9 => )
calucualte number / 10 and store in number
calculate number % 10 and store in value2  (36%10 = 6 => )
calucualte number / 10 and store in number
now add number, value1 and value 2 
  • Lets make ishika calculate sum of any number
Hi ishika
Remember 3691 as number
Remember 0 as sum
until number not equals 0 try below steps
    calculate number%10 and add it to sum
    calculate number/10 and assign it to number
end until
say sum
  • Exercise: i have invested 10 lakhs in a mutual fund which gave 12% returns. I have invested 10 lakhs when i was 24 years old now i’m 60 what is the total amount. Refer Here. Find the forumla for lumpsum returns calculation.

  • Operators:

    • Assignment: number = number%10 => calcuate number mod 10 and assign it to number
    • equals =
    • not equals !=
    • greater than lt, lte, gte > < <= >=

Debugging

  • consider the below conversation
Hi ishika
Remember 19835 as number
Remember 0 as sum
until number not equals 0 try below steps
    calculate number%10 and add it to sum
    calculate number/10 and assign it to number
end until
say sum

References

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Plugin for Social Media by Acurax Wordpress Design Studio
Exit mobile version
%%footer%%