Skip to main content

Posts

Web Applications

Recent posts

PyThon - Notes

  \...NOTES.../ --------------------------------------------------------------- Day 1 - What is Programming and Python? 1) What is Programming • Programming is a way for us to tell computers what to do. Computer is a very dumb machine and it only does what we tell it to do.  • Hence, we learn programming and tell computers to do what we are very slow at - computation. If I ask you to calculate 5+6, you will immediately say 11.        How about 23453453 X 56456? • You will start searching for a calculator or jump to a new tab to calculate the same. These 100 days of code series will help you learn  • python from starting to the end. We will start from 0 and by the time we end this course, I promise you will be a Job ready Python developer! 2) What is Python? • Python is a dynamically typed, general purpose programming language that supports an object-oriented programming approach as well as a functional programming approach. • Python is an interpreted and a high-level programming langua

PyThon - Code

\...CODE.../ --------------------------------------------------------------- def main():     x = int(input("What is x? " ))     print("x squared is ", square(x)) def square(n):     return n*n main() --------------------------------------------------------------- def main():     x = int(input("What is X? "))     if is_even(x):         print("Even")     else:         print("Odd") def is_even(n):     if n % 2 ==0:         return True     else:         return False #   return True if n % 2 == 0 else False #orrrr #   return n % 2 == 0 #orrrrrrr main() --------------------------------------------------------------- name = input("What is Your Name : ") name = name.title() match name:     case "Shailesh" | "Kusum" | "Parth":         print("Hello, " + name + "! You live in Naiya - 1.")     case "Ketan" | "Nirali" | "Aarohi":          print("Hello, &quo