#-*-Coding:utf-8-*-#
# Filename:test.py
# author By:www.runoob.com
# User input Celsius temperature
# Receive user input
cel = float(input (' enter Celsius temperature: '))
# Calculate Fahrenheit temperature
Fahrenheit = (CEL * 1.8) +
Print('%0.1f Celsius temperature to Fahrenheit%0.1f '%(cel, Fahrenheit)
#简化下
Print(' input Celsius%0.1f converted to Fahrenheit to%0.1f '%(cel, (cel*1.8) +32))
#-*-Coding:utf-8-*-
# Filename:test.py
# author By:www.runoob.com
# user Input
x = input(' input x value: ')
y = input(' input y value: ')
# Create a temporary variable and swap
x, y = y, x
Print( The value of x after Exchange is: {} '. Format(x))
Print( the value of ' after Exchange y is: {} '. Format(y))
#程序都是按顺序执行
#看似很矛盾, in fact, in line with machine language
#-*-Coding:utf-8-*-
# Filename:test.py
# author By:www.runoob.com
# user Input
x = input(' Please enter the value of x: ')
y = input(' re-enter the value of y: ')
#来交换吧
x, y = y , x
#哈哈输出执行结果吧
Print("The value of x has been switched to {}". Format(x))
Print(' y ' value is switched to {} '. Format(y))
#程序都是按顺序执行
#看似很矛盾, in fact, in line with machine language
Python daily updates, get new knowledge