Python日常更新,get新知识

Posted deletewang

tags:

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

 

# -*- coding: UTF-8 -*-#  

 

# Filename : test.py

# author by : www.runoob.com

 

# 用户输入摄氏温度

 

# 接收用户输入

cel = float(input(‘输入摄氏温度: ‘))

 

# 计算华氏温度

fahrenheit = (cel * 1.8) + 32

print(‘%0.1f 摄氏温度转为华氏温度为 %0.1f ‘ %(cel,fahrenheit))

#简化下

print(‘输入摄氏温度%0.1f转化为华氏温度为%0.1f‘%(cel,(cel*1.8)+32))

 

# -*- coding: UTF-8 -*-

 

# Filename : test.py

# author by : www.runoob.com

 

# 用户输入

 

x = input(‘输入 x 值: ‘)

y = input(‘输入 y 值: ‘)

 

# 创建临时变量,并交换

 

x,y = y,x

print(‘交换后 x 的值为: {}‘.format(x))

print(‘交换后 y 的值为: {}‘.format(y))

 

#程序都是按顺序执行

#看似很矛盾,其实符合机器语言

 

# -*- coding: UTF-8 -*-

 

# Filename : test.py

# author by : www.runoob.com

 

# 用户输入

 

x = input(‘请输入x的值:‘)

y = input(‘再输入y的值:‘)

 

#来交换吧

x,y = y ,x

 

#哈哈输出执行结果吧

print("x的值交换之后竟然变成了{}".format(x))

print(‘y的值交换之后竟然变成了{}‘.format(y))

 

#程序都是按顺序执行

#看似很矛盾,其实符合机器语言

以上是关于Python日常更新,get新知识的主要内容,如果未能解决你的问题,请参考以下文章

ChatGPT王炸更新!联网get新知识

Python错误日常记录(持续更新)

你必须知道的python运维常用脚本!(日常更新)

python日常—爬取豆瓣250条电影记录

基于 webdriver 的测试代码日常调试方python 篇

运维日常集合(个人向 坚持更新)