1.编写一个程序,使用输入提示用户输入他的名字,然后"Welcomes"他。
Example:
Enter your name: Charlie
Hello Charlie
name = input ('Enter your name:')#input()输入
print ('Welcomes', name)#print()输出
2.编写程序以提示用户输入小时和小时费率来计算总工资。
Example:
Enter Hours: 35
Enter Rate: 2.75
Pay: 96.25
hours = input ('Enter Hours:')
rate = input ('Enter Rate:')
pay = float(hours) * float(rate)
print ('Pay:', pay)
3.编写一个程序,提示用户输入摄氏温度,将温度转换为华氏度,并打印出转换后的温度。
Equation:
Celsius = (Fahrenheit - 32.0) * 5.0 / 9.0
Celsius = input ('Enter Celsius:')
Fahrenheit = float (Celsius) / 5.0 * 9.0 + 32
print ('Fahrenheit:' , Fahrenheit)