Introduction

Introduction to Programming

Main Parts of Computer: Computer is made of different parts.

CPU

CPU or Central Processing Unit is the brain of computer. It is very good at doing one work at a time and at a very fast speed. 

RAM

RAM or Random Access Memory is the memory of computer to store things it wants for some time.

Devices

You can connect different types of devices to Computer such as Monitor, Mouse, Keyboard, Printer, Speakers, Headphones etc. These devices can be of Input types such as Mouse, Keyboard, and Mics, or of Output types such as Monitor, Printer etc. Some devices can work as Input and Output both. For example modern multi-systems

Purpose of Programming

Purpose of programming is to control the input and output devices connected to computer. We will start with programming monitor as output device.

Python

Python is an easy to understand programming language for kids. You can get the latest version of Python from https://www.python.org/downloads/.

Start Python

Once you have Python installed, you can open command prompt and type "python". Once you see a prompt with ">>>" three angular brackets, you are on

akhileshtiwari$ python

Python 2.7.16 (default, Aug 24 2019, 18:37:03) 
[GCC 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.32.4) (-macos10.15-objc-s on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

print function

  • You use print function to print something on the monitor's screen. 


>>> print("hello world!")
hello world!
>>> 

  • You can pass string values in single and double quotation marks to print the value on screen. 
    • Check why there are two options to pass single and double quotation marks.


Variables

Variables are like small boxes to store things. You can store different types of values such as string, and number can be store in these variables.


Assignments

https://raw.githubusercontent.com/akhileshtiwari/PythonAssignments/master/input_print.text

Comments

  1. Aashi-
    # Answers from Aashi
    #1.
    print("Hello World!\n\nHi,I'm home.\n\nOsh says \"Hello Radha!\"\n\nRadha says \"Hello Osh.How're you?\"")



    #2. Any data or information that is provided to pass in a function.


    #3.The value returned by a passed function.



    #4. The input function collects data or information from the users. It does take parameters(a string which shows on the user's screen, usually a question for the data.)

    #5.A string return value.

    #6:
    #a. print(Hello World!)
    print("Hello World!")

    #b. print("Hello "How are you?"")
    print('Hello "How are you?"')

    #c. print("Good morning')
    print("Good morning")

    #d. print(2345) No error

    #e. print("Hello world" + 'how is everyone') No error

    ReplyDelete

Post a Comment