当前位置:网站首页>[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
边栏推荐
- Gbase 8C - SQL reference 6 SQL syntax (11)
- 5. Indexing and slicing
- 10. Gradient, activation function and loss
- Matlab 画图(超详细)
- pytorch的多GPU训练的两种方式
- SoK: The Faults in our ASRs: An Overview of Attacks against Automatic Speech Recognition (题目过长)阅读笔记
- Live Home 3D Pro室内家居设计工具
- pytorch模型
- std::bind与std::function的一些应用
- socket编程一:使用fork()实现最基础的并发模式
猜你喜欢

向量和矩阵的范数

Digital image processing Chapter 8 - image compression

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

【5·20特辑】MatLAb之我在和你表白
![[concurrent programming series 9] priorityblockingqueue, delayqueue principle analysis of blocking queue](/img/2b/1bfadbffad33f8560357fab74e8308.png)
[concurrent programming series 9] priorityblockingqueue, delayqueue principle analysis of blocking queue

导数、偏导数以及梯度

Lightroom Classic 2022 v11.4中文版「最新资源」

What has been updated in the Chinese version of XMIND mind map 2022 v12.0.3?

2. Simple regression problem

10. Gradient, activation function and loss
随机推荐
如何管理大量的定时任务
【头歌】重生之我在py入门实训中(12):Matplotlib接口和常用图形
Gbase 8C - SQL reference 6 SQL syntax (7)
Digital image processing Chapter 2 fundamentals of digital image
模型的推理速度
socket编程二:使用select
使用-Wall清除代码隐患
Digital image processing -- Chapter 9 morphological image processing
ps 2022 六月更新,都新增了哪些功能
Can it replace PS's drawing software?
神经网络参数初始化
Baiwen driving Daquan learning (II) I2C driving
2. Simple regression problem
Weidongshan digital photo frame project learning (I) display ASCII characters on LCD
7. Merger and division
剪枝-量化-转onnx中文系列教程
Gbase 8C - SQL reference 6 SQL syntax (14)
【头歌】重生之我在py入门实训中(1)
【头歌】重生之深度学习篇-Keras(初级)
Multi task foundation of IOT operating system