当前位置:网站首页>[first song] rebirth of me in py introductory training (3): if conditional sentence
[first song] rebirth of me in py introductory training (3): if conditional sentence
2022-07-27 06:05:00 【Collapse an old face】
Unbearable treasures come here for reference , Just a like + Focus on , Please
The first 1 Turn off : Will enter three integers x,y,z Arrange in order from small to large
This task is to input three integers x,y,z Arrange in order from small to large , I.e. implementation step1/ThreeNumberSort.py The code in the file is as follows :
# -*- coding:utf-8 -*-# Arrange the three numbers from small to largeimport sysx,y,z=map(int,sys.stdin.readline().split()) #x,y,z Respectively equal to the three numbers entered in the current line ( Three numbers are separated by spaces )# Please add the implementation code here
# Please add the implementation code here
if x>y:
x,y=y,x
if y>z:
y,z=z,y
if x>y:
x,y=y,x
print(x,y,z) The first 2 Turn off : Judge whether the entered year is a leap year
#### Our mission
The task of this level is to judge whether the entered year is a leap year , I.e. implementation step3/LeapYear.py The code in the file is as follows :
# -*- coding:utf-8 -*-# Judge whether the entered year is a leap yearx=eval(input()) #x Is the year entered# Please add the implementation code here , Implement judgment x Leap year or not
# Judge whether the entered year is a leap year
x=eval(input())
# Please add the implementation code here
if (x%4==0 and x%100!=0) or (x%400==0):
print('Yes')
else:
print('No') notes : The content is only for reference and sharing , Do not spread without permission , Tort made delete
边栏推荐
猜你喜欢

arcgis for js api(2) 获取要素服务的id集合

PS 2022 updated in June, what new functions have been added

12. Optimization problem practice

2022.6.10 STM32MP157串口时钟的学习

数字图像处理 第二章 数字图像基础

Speech and Language Processing (3rd ed. draft) Chapter 2 ——正则表达式,文本归一化,编辑距离 阅读笔记

Matlab 画图(超详细)

6. Dimension transformation and broadcasting

16. Over fitting and under fitting

11. Gradient derivation of perceptron
随机推荐
Chrome 如何快速将一组正在浏览的网页(tabs)转移到另一台设备(电脑)上
Only one looper may be created per thread
17. Attenuation of momentum and learning rate
【头歌】重生之我在py入门实训中(2):公式编程
安全帽反光衣检测识别数据集和yolov5模型
西瓜书学习第五章---神经网络
WebODM win10安装教程(亲测)
李宏毅 2020 深度学习与人类语言处理 DLHLP-Conditional Generation by RNN and Attention-p22
Numpy basic learning
Gbase 8C - SQL reference 6 SQL syntax (14)
IOT operating system
Kaggle调用自定义模块方法
模型的推理速度
pytorch模型
【头歌】重生之我在py入门实训中(5):列表
Digital image processing Chapter 8 - image compression
Can it replace PS's drawing software?
Speech and Language Processing (3rd ed. draft) Chapter 2 ——正则表达式,文本归一化,编辑距离 阅读笔记
谈谈为何需要将类的成员函数声明为private
c语言-线性顺序表