Tuesday 17 December 2019

IBM off campus drive December 2019 coding programs

1. Sum of arithmetic progression numbers. Eg: 1+2+3+4+5 =15
2. Print number in reverse binary. Eg: Decimal =9      Binary= 1001
3. Convert number to Roman numerals.
          Eg:     Symbol         I      V        X        L
                     Value            1      5        10       50
4. Area of an ellipse.
5. Print the pyramid.
              *
           * * *
       * *  *  * *
6. Time taken to start a job , first come first serve(FCFS)

What is cyber physical system (CPS)?


A cyber-physical system (CPS) is a mechanism controlled by a computer based algorithm, strongly integrated with internet and its users. 
Examples of CPS are as follows: medical monitoring, process control systems, smart grid, robotics systems, autonomous automobile systems and automatic pilot avionics.

Friday 13 December 2019

Python Comments

Python Comments can be used to
                  - explain Python code.
                  - make the code more readable.

Comments starts with a #, and Python will ignore them:
Single line comment
Examples
1)     #This is a comment
        print("Good Morning")
2)     print("Welcome") #This is a comment
3)    #print("Good Morning")
        print("Good Evening")

Multi Line Comments
Python does not really have a syntax for multi line comments.
To add a multiline comment you could insert a # for each line:
Example
#This is a comment
#written in
#more than just one line
print("good evening")

Multiline string(triple quotes)
multiline string (triple quotes) place your comment inside it
Example

"""
This is a comment
written in
more than just one line
"""
print("Hello, Good Morning")

Python Keywords

Python has a set of keywords that are reserved words that cannot be used as variable names, function names, or any other identifiers.

and as assert break class
continue def del elif else
exceptFalsefinallyfor from
global if import in is
lambda None nonlocal not or
pass raise return True  try
while with yield

What is Python ?


  • Python is a programming language.
  • Python is a case-sensitive language.
  • It was created by Guido van Rossum, and released in 1991.
  • Python is used for web development (server-side), software development and mathematics.
  • Python can connect to database systems.
  • Python can be used to handle big data and perform complex mathematics.
  • Python is a cross-platform language,It means that Python works on different platforms i.e Windows, Mac OS X, Linux, Raspberry Pi, etc.
  • Python has syntax that allows developers to write programs with fewer lines than some other programming languages.
  • Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick.
  • Python can be treated in a procedural way, an object-orientated way or a functional way.
  • Python uses new lines to complete a command, as opposed to other programming languages which often use semicolons or parentheses.
  • Python relies on indentation, using whitespace, to define scope; such as the scope of loops, functions and classes. Other programming languages often use curly-brackets for this purpose.