Computer Learning

All About Computer And Technology

  • Home
  • Python Programming
    • How To Find Maximum And Minimum Value On Python Programming Language
    • Creating Tuple, List, and Dictionary on Python Programming Language
    • Learning about Input value using Python easily
    • Creating Function on Python Programming Language
    • Read More >>
  • Komputer
    • Program Execution (Organization and Architecture Computer)
    • Microcontroller of Von Neumann vs Havard and CISC vs RISC
    • Definition and Function of Control Unit
  • Blog Tutorial
    • How to Make Table of Content with Sroll in Blogspot
    • How to make Claim or Get Verification Our Blogs to Alexa
  • Tips dan Trik
    • How To Solve Red Cross In Blackberry
    • How to Restore Deleted File in Smartphone Memory Using Recuva
    • Selengkanya >>
  • Contact Me
Home » Python Programming Language » How To Find Maximum And Minimum Value On Python Programming Language

How To Find Maximum And Minimum Value On Python Programming Language

Joni
Add Comment
Python Programming Language
Monday, August 11, 2014


On my writing before, you have learned about tuple, list, and dictionary. You have to truly understand the topics before continuing to next step phases. Why ? because on my writing toda, we will be on advanced phases. Whereas on my writing before, we were on based introductions phase about Python Programming Language. I consider you have understood about all of based in Python. For you who is first time visiting this blog, you can explore first to my writings before so that making easy your learning. Well, as the title above we will learn about How to Find Maximum and Minimum Value on a sequence of numbers. For example, there is a sequence that contains a thousand numbers and then we want to make a program to find the largest number and the lowest number. How to make these program ? let see carefully below :
  1. Maximum Value

    def maxNumber(List) :--> Making function named maxNumber
        maxNumber = 0--> Making variable named maxNumber with value 0
        for element in List :--> Looping, checking the sequences of List one by
          one represented by var element
            if element > maximum :--> If var element more than var maximum, so :
            maximum = element--> Var maximum is equal with the var element above
        return maximum--> Printing var maximum (it has chosen the
          largest number)

    Explanations :

    • def function, to make a function
    • var maximum = 0
      The point is when we make a function to find maximum value, we have to make first variable with value less than all of elements in the sequence and otherwise.
    • for function is looping on executing instuctions its below.
    • if element > maximum
      Comparation between element and maximum. If element is more than maximum, so value of maximum is equal with the element. And then the program will repeat continuouly until the last element of the sequence. The result is var maximum with the largest element.

    I will give you an example below :


  2. Minimum Value
  3. def minNumber(List) :--> Making function named minNumber
        minNumber = 0--> Making variable named minimum with value 0
        for element in List :--> Looping, checking the sequences of List one by
         one represented by var element
            if element > miniimum :--> If var element more than var minimum, so :
            minimum = element--> Var minimum is equal with the var element above
        return minimum--> Printing var minimum (it has chosen the
    largest number)

    Explanations :

    • Running of the program between maxNumber and minNumber functions are same, only comparation and value that are compared are different.

      We should see this example below :
I think this topic is not pretty difficult to understand, the most important is, you have to practice more to solve any problems. If you have not understood with the learning above, please ask me on comment column below, OK !
Tweet
How To Find Maximum And Minimum Value On Python Programming Language Title : How To Find Maximum And Minimum Value On Python Programming Language
Description : On my writing before, you have learned about tuple, list, and dictionary. You have to truly understand the topics before continuing to nex...
Rating : 5

0 Response to "How To Find Maximum And Minimum Value On Python Programming Language"

Post a Comment

← Newer Post Older Post → Home
Subscribe to: Post Comments (Atom)

Popular Post

  • Program Execution (Organization and Architecture Computer)
    How to read this figure below ?  Notes  : Program Counter (PC) = Address of Instruction  Instruction Register (IR) = Ins...
  • How to Write Matematics Formulas on Python Programming Language
    Good night all programmers?  As my writing before about Learning if, for, and while function on Python Programming Language, I wil...
  • Microcontroller of Von Neumann vs Havard and CISC vs RISC
    Microcontroller of Von Neumann vs Havard and CISC vs RISC | pemprograman | komputer | bahasa python Microcontroll...
  • How to Use If, For, and While on Python Programming Language
    Welcome back to my page guys !    I’m happy to meet you again my friends because you all are the next generation on this country. We ...
  • How To Find Maximum And Minimum Value On Python Programming Language
    On my writing before, you have learned about tuple, list, and dictionary. You have to truly understand the topics before continuing to nex...
  • Contact Me On
    Contact Me on : e-mail : joni67676@gmail.com Facebook : John Twitter : @simplechilds Google + : Jhon Gu...
  • Creating Tuple, List, and Dictionary on Python Programming Language
    We have learned about Creating Function on Python Programming Language on my writing before. Now, we have to know how to collect a sequenc...
  • Definition and Function of Control Unit
    Definition and Function of Control Unit | pemprograman | komputer | bahasa python Control unit control CPU opera...

Label Cloud

  • Blog Tutorial
  • Komputer
  • Python Programming Language
  • Tips Trick

Blog

  • ▼  2014 (15)
    • November 2014 (1)
    • October 2014 (1)
    • September 2014 (3)
    • August 2014 (3)
    • July 2014 (7)

Followers

Mengenai Saya

Joni
View my complete profile
Back to top!
Copyright 2013 Computer Learning - All Rights Reserved Design by Mas Sugeng - Powered by Blogger