Thursday, August 6, 2020

PYTHON CODES

PYTHON CODES
 
  •  A statement or expression is an instruction the computer will run or execute.
  • The value in the parentheses is called the argument.




  • A Semantic error is when your logic is wrong.

    print("Hello\nWorld!")

    Hello
    World!



    Expressions describe a type of operation that computers perform.








    1. We can bind a string to another variable.
    2. It is helpful to think of string as a list or tuple.

    `We can treat the string as a sequence and perform sequence operations.


    We can also input a stride value as follows. The 2 indicates we select every second variable.

















    1. we set the variable A to the following value.
    2. We apply the method "upper" and set it equal to "B“.






    1. The method find, finds sub-strings. The argument is the sub-string you would like
    2. to find. The output is the first index of the sequence.
    3. We can find the sub-string Jack. If the sub-string is not in the string, the
    4. output is negative one.

    MODULE 2


    lists and tuples, these are called compound data types
    Tuples Tuples are an ordered sequence.






















    No comments:

    Post a Comment