6小时完全入门python-达到开发网站的能力

环境:Linux
编译器:Pycharm
教程:https://www.bilibili.com/video/BV14J411U7hj/

print("Olivia Zhang")
print('*'*10)       

price = 10   # 变量
price = 20
print(price)

name = "Olivia" 
age = 20 
is_new = True  # blool
print(name, age, is_new)

name = input('What is your name? ')
color = input('What is your favourite color? ')
print(name +' likes ' + color)

weight_lbs = input("Weight(lbs): ") #输入是char
weight_lbs = float(weight_lbs)  #类型转换,int()
weight_kg = weight_lbs *0.45
print (weight_kg)


# f加{},在字符串中动态的插入值
first = 'John'
last = 'Simth'

msg = f'{first} [{last}] is a coder' # 有问题
print(msg)


course = 'Python for Beginners'
print(course.title())
# 其他字符串操作的函数
course.upper()
course.lower()
course.find()
course.replace()

#除法
print(10/3) # = 3.3333333

print(10//3) # = 3
print(10%3)# =1 余数



price = 1000000
is_goodcredit = True

if is_goodcredit:
    down_payment = 0.1 * price
else:
    down_payment = 0.2 * price
down_payment = 'down payment is $'+str( down_payment)
print(down_payment)





  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值