当前位置:考试网  > 试卷库  > 计算机类  > 等级考试  > 计算机二级  > Python语言程序设计  > 请用Python语言编写一个简易的猜数字游戏程序。
试题预览

请用Python语言编写一个简易的猜数字游戏程序。

查看答案
收藏
纠错
正确答案:

import random

answer = random.randint(1,10)

print('猜数游戏 ')

num=input('请输入你猜测的数字 n')

guess=int(num)

n=0

while n<2:

if guess == answer and n==0:

print('么么哒。对啦 ')

print('厉害了一次就对了 ')

break

if guess < answer:

print('不对哦,太小了 ')

elif guess > answer :

print('不对哦,太大了 ')

elif guess==answer :

print('么么哒。对啦 ')

num=input('请你重新输入 n')

guess=int(num)

n=n+1

if n==1 and guess==answer:

print('可以哦,第二次就对了 ')

break

elif n==2 and guess ==answer:

print('还行,终于猜出来了 ')

break

elif n==2 and guess !=answer :

print('不行哦,三次都不对 ')

break

print('游戏结束 ')

答案解析:

暂无解析

你可能感兴趣的试题

下面不属于软件工程的3个要素的是

下列有关数据库的描述,正确的是

以下关于字符串类型的操作的描述,错误的是:

下列不属于结构化分析的常用工具的是

下列关于栈的叙述中正确的是

热门试题 更多>
试题分类: 初级(口语)
练习次数:0次
试题分类: 初级(口语)
练习次数:0次
试题分类: 初级(写作)
练习次数:0次
试题分类: 口语
练习次数:0次
Section D Even if you get work done and generally get along with co-workers, you could have habits that bug your boss (not to mention your officemates). While these quirks may not necessarily get you fired, they certainly can keep you from climbing the corporate ladder. We’ve uncovered a number of habits that bug your boss and offer tips on how to avoid them. According to LaRhonda Edwards, a human resources manager with thirteen years of HR experience, tardiness is one of the biggest concerns for managers. “If the normal work day starts at 8 o’clock, then the expectation is that you’re in the office ready to start your day,” she explains. Her advice to the chronically late? “Plan ahead,” she urges. “If you live 50 minutes away, you don’t leave 50 minutes early. Tag on extra time and anticipate road blocks.” Some people even set their clocks a few minutes early to ensure that they’re on time. Different bosses prefer different modes of communication. Lindsey Pollak, a workplace expert and author of Getting from College to Career, says if you text your boss and she prefers in-person meetings, “either your information won’t get across or you’ll irritate [her].” Fortunately, there’s a simple fix: ask your boss how and when to send updates. If you’re too shy to ask outright, then Pollak suggests observing how they communicate with you. “If you have a boss who communicates once a day by email, that’s the boss’ preferred frequency and method of communication,” explains Pollak. A cluttered, messy work space can give your boss the impression that you’re lazy or disorganized, so try to keep your desk neat. “Never put more on your desk than you’re going to work on for the day,” recommends Edwards. “At the end of the day, make sure you set up for the next day. I may be working on five things at once, but at the end of the day, they’re gone, and I set up for the next day.” Most managers would rather you ask a question than make a mistake, but many questions can be answered on your own. “Is this something you could Google or ask a colleague?” wonders Pollak. “The internet is so vast that a lot of information you can get yourself.” If you must approach your boss with a question or issue, then Pollak recommends brainstorming beforehand. “Rather than saying ‘This client is terrible. What should I do?’ think about potential solutions,” she says. Cell phones are practically ubiquitous in the workplace these days, but it’s still disruptive and disrespectful when they go off during a meeting. Edwards says that you should, “put your cell phone on vibrate or leave it in your own office so it’s not a distraction.” That way you won’t be tempted to text either ( )6.According to the article, how many pieces of advice are offered here? . A. Two B. Three C. Four D. Five(B) ( )7.What is this article about? . A. How to be successful in the workplace. B. How to communicate with your boss. C. How to avoid quirks that annoy your boss. D. How to utilize your mobile phones at work. ( )8.What does the phrase “to get across” in the sentence “…she prefers in-person meetings, “either your information won’t get across or you’ll irritate …” of the second paragraph mean? . A. To be communicated B. To be passed C. To be promoted D. To be anticipated(A) ( )9.According to the article, which of the following modes of communication is the best when communicating with your boss? . A. Any ways you think are appropriate. B. In-person meetings. C. Correspondence. D. The way your boss communicates with you.(D) ( )10.Which of the following statements is not mentioned? A. Employees should pay respect to their bosses anytime. B. Employees should plan beforehand so as to show up at work on time. C. Employees should not let their mobile phones go off during meetings. D. Employees should keep their desks neat and organized.
试题分类: 初级(阅读)
练习次数:26次
扫一扫,手机做题