Python daily updates, get new knowledge

Source: Internet
Author: User

#-*-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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.