当前位置: 首页 > news >正文

国内最大的c2c网站是网站后台发邮件

国内最大的c2c网站是,网站后台发邮件,深圳怎么建设网站,京东商城网站建设方案书计算器 创建一个简单的计算器#xff0c;能够进行加、减、乘、除四种基本运算。 # 定义加法函数 def add(x, y):return x y# 定义减法函数 def subtract(x, y):return x - y# 定义乘法函数 def multiply(x, y):return x * y# 定义除法函数 def divide(x, y):if y 0:return…计算器 创建一个简单的计算器能够进行加、减、乘、除四种基本运算。 # 定义加法函数 def add(x, y):return x y# 定义减法函数 def subtract(x, y):return x - y# 定义乘法函数 def multiply(x, y):return x * y# 定义除法函数 def divide(x, y):if y 0:return Error! Division by zero. # 防止除以零return x / y# 打印操作选项 print(Select operation:) print(1. Add) print(2. Subtract) print(3. Multiply) print(4. Divide)# 获取用户选择的操作 choice input(Enter choice(1/2/3/4): )# 获取用户输入的两个数字 num1 float(input(Enter first number: )) num2 float(input(Enter second number: ))# 根据用户选择的操作调用相应的函数 if choice 1:print(f{num1} {num2} {add(num1, num2)}) elif choice 2:print(f{num1} - {num2} {subtract(num1, num2)}) elif choice 3:print(f{num1} * {num2} {multiply(num1, num2)}) elif choice 4:print(f{num1} / {num2} {divide(num1, num2)}) else:print(Invalid input) # 处理无效输入猜数字游戏 编写一个猜数字游戏计算机随机生成一个1到100之间的数字用户需要猜这个数字程序会提示猜大了还是猜小了直到猜对为止。 import random # 导入随机数模块# 生成一个1到100之间的随机数 number_to_guess random.randint(1, 100) attempts 0 # 初始化尝试次数print(Guess the number between 1 and 100)while True:guess int(input(Enter your guess: )) # 获取用户猜测的数字attempts 1 # 尝试次数加一if guess number_to_guess:print(Too low!) # 提示猜的数字太小elif guess number_to_guess:print(Too high!) # 提示猜的数字太大else:print(fCongratulations! Youve guessed the number in {attempts} attempts.) # 猜对了break # 结束循环简单的记事本 创建一个简单的记事本应用用户可以添加、查看和删除笔记。 notes [] # 初始化一个空列表来存储笔记# 添加笔记的函数 def add_note():note input(Enter your note: )notes.append(note)print(Note added!)# 查看所有笔记的函数 def view_notes():print(Your notes:)for i, note in enumerate(notes, 1):print(f{i}. {note})# 删除笔记的函数 def delete_note():view_notes() # 先显示所有笔记note_index int(input(Enter the note number to delete: )) - 1if 0 note_index len(notes):del notes[note_index]print(Note deleted!)else:print(Invalid note number) # 处理无效输入# 主循环 while True:print(\n1. Add Note)print(2. View Notes)print(3. Delete Note)print(4. Exit)choice input(Enter your choice: )if choice 1:add_note()elif choice 2:view_notes()elif choice 3:delete_note()elif choice 4:break # 退出循环else:print(Invalid choice. Please try again.) # 处理无效选择简单的联系人管理系统 创建一个简单的联系人管理系统可以添加、查看、删除联系人。 contacts {} # 初始化一个空字典来存储联系人# 添加联系人的函数 def add_contact():name input(Enter contact name: )phone input(Enter contact phone number: )contacts[name] phoneprint(Contact added!)# 查看所有联系人的函数 def view_contacts():print(Your contacts:)for name, phone in contacts.items():print(fName: {name}, Phone: {phone})# 删除联系人的函数 def delete_contact():name input(Enter the name of the contact to delete: )if name in contacts:del contacts[name]print(Contact deleted!)else:print(Contact not found) # 处理联系人未找到的情况# 主循环 while True:print(\n1. Add Contact)print(2. View Contacts)print(3. Delete Contact)print(4. Exit)choice input(Enter your choice: )if choice 1:add_contact()elif choice 2:view_contacts()elif choice 3:delete_contact()elif choice 4:break # 退出循环else:print(Invalid choice. Please try again.) # 处理无效选择简单的待办事项列表 创建一个简单的待办事项列表应用可以添加、查看和删除待办事项。 todo_list [] # 初始化一个空列表来存储待办事项# 添加任务的函数 def add_task():task input(Enter a new task: )todo_list.append(task)print(Task added!)# 查看所有任务的函数 def view_tasks():print(Your tasks:)for i, task in enumerate(todo_list, 1):print(f{i}. {task})# 删除任务的函数 def delete_task():view_tasks() # 先显示所有任务task_index int(input(Enter the task number to delete: )) - 1if 0 task_index len(todo_list):del todo_list[task_index]print(Task deleted!)else:print(Invalid task number) # 处理无效输入# 主循环 while True:print(\n1. Add Task)print(2. View Tasks)print(3. Delete Task)print(4. Exit)choice input(Enter your choice: )if choice 1:add_task()elif choice 2:view_tasks()elif choice 3:delete_task()elif choice 4:break # 退出循环else:print(Invalid choice. Please try again.) # 处理无效选择
http://www.hkea.cn/news/14483427/

相关文章:

  • 湖南响应式网站建设公司简介宣传
  • 关于春节的网站设计html重庆市建设银行网站首页
  • 自助建站系统个人网站网站简介 title
  • 建一个商城网站多少钱宁波模板建站定制网站
  • iis7.5 查看网站流量响应式网站介绍
  • 网站开发需要哪些如何做网站的伪静态页面
  • 做网站一般有几个关键词制作制作网站开发
  • 用python做网站后台恩施北京网站建设
  • 怎么看一个网站谁做的优化沈阳化工大学建设工程网
  • 公司网站备案申请家装网站模板下载
  • 苏州做网站优化网站及商品排名怎么做
  • 网站搭建用什么软件四川网站seo设计
  • 做网站好还是阿里巴巴wordpress+行间距插件
  • 泉州地区网站建设公司深圳官方网站
  • 静态网站有哪些优点万网定制网站怎么样
  • 如何给wordpress添加一张网站背景微平台小程序
  • 如何自己开发微网站那些网站是针对物流做的
  • 单页网站制作永康市住房和城乡建设局网站
  • 建微网站有什么好处做拍卖网站
  • 免费做快闪网站网站首页制作采用
  • 哈尔滨站建站时间百度关键词投放
  • 普像工业设计网站简单做网站的软件
  • 深圳专门网站建设wordpress 文章状态
  • 描述网站建设的基本流程图那里做网站
  • 常州平台网站建设现在做一个网站多少钱
  • led设计网站建设上饶做网站哪家好哦
  • 网站建设与运营网站建设与开发开题报告
  • 怎样安装微信小程序网站优化外包找谁
  • 海报自动设计网站看视频的软件哪个最好免费
  • 网站的成本网站刷单账务处理怎么做