python的题目在哪里能搜到答案,哪里可以找到一些python的练习题呢

1.1.1 Calculating a price with tax

Write a program that ask the user to enter a price without tax, a tax rate and a number of items

bought, then calculate and display the tax amount of the purchase.

1.1.2 Swap two variables

Write three programs realizing an exchange of values between two variables entered by the user:

1. Using multiple assignment (Python’s own version).

2. Without use of multiple assignment (Version usable with other languages).

3. Using the + and - operators (this implies that variables are both numbers).

1.1.3 Swap of three variables

Write a program realizing the circular permutation of three variables x, y and z whose values are

entered by the user. This means that at the end of the program, x contains the initial value of y, y

contains the initial value of z and z the initial value of x.

1.1.4 Time conversion (1)

Write a program requiring a time in seconds to the user, and converts it to hours, minutes,

seconds. For example, 12334 seconds become 3 hours, 25 minutes and 34 seconds.

1.1.5 Time conversion (2)

Write a program requiring time in hours, minutes and seconds to the user and converts in

seconds. For example 3 hours, 25 minutes and 34 seconds will become 12,334 seconds.

1.2 STRUCTURES AND CONDITIONAL ITERATIVE (1)

1.2.1 Calculation of a discount

A merchant gives a 5% discount for every purchase of an amount between 100 and 500 € and 8%

thereafter. Write a program to calculate the amount of the discount on a given purchase.

1.2.2 Whether three integers are sorted

Write a program that ask for three integers x, y, z to the user, indicating whether these numbers

are in ascending order (x <= y <= z).

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值