the Way of Python Day 2

Posted margin1314

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了the Way of Python Day 2相关的知识,希望对你有一定的参考价值。

  today,i got lots of knowledge of python ,like how to get the maximum value of three numbers.

  similarly i already was able to write a program of how to get the minium number among many numbers.

  here is the minium value program:

num_one=input("enter number one :")
num_two=input("enter number two :")
num_three =input("enter number three :")

min_num = 1

if num_one>num_two :
min_num= num_one
else :
min_num= num_two
if min_num >num_three:
min_num = num_three
print("the minium number is",min_num)

  here is the maximum value program:

num1=input("enter Num1:")

num2=input("enter Num2:")

num3=input("enter Num3:")

max_num=0

if num1>num2:
max_num=num1
else :
max_num=num2
if max_num < num3:
max_num = num3
print("the max num is ",max_num)

  i would share my experience about these two programs,maybe you could get something from it.

at first , use input to get three numbers.

then ,choose two numbers of them to compare size,and get the larger number.

in the end ,pick the last number to compare with the larger number,so get the maximum number.















以上是关于the Way of Python Day 2的主要内容,如果未能解决你的问题,请参考以下文章

reviews of learn python3 the hard way

Python on the Way, Day1 - Python基础1

the way of reading English books

learn python the hard way 习题6~10总结

Introducing Custom API – The New Way of Creating Custom Actions in Dataverse

Most efficient way to get the last element of a stream