Computer basic knowledge and basic programming

Contents

  • What is a computer
  • < li>The history of computer development

  • How to complete our needs through computers
  • Classification of computers
  • Operating system
  • Programming language
  • li>

  • The role of programming language
  • python temperature conversion
  • day01 practice

What is a computer

A computer is a tool used to play games, pick up girls, read novels, read books, and watch movies. Computers can help us fulfill our needs.

Sweeping robots (Computer): Sweeping the floor

Robot arm (computer): Processing products

People (noble people)–“Slaves do it

Producing slaves (machines) (Computer))

Computers are for us humans: slaves, fulfill our needs

History of computer development

In 1946, the first computer Eniak was born, used to decipher the code

Design the route of the missile

How to use the computer to complete us

If there is nothing, the computer is scrap copper and rotten iron

  1. Charge
  2. Turn on (start a thing—“Control scrap copper Rotten iron)

Classification of computers

Hardware: scrap copper and rotten iron

Software: except for scrap copper Iron is software

operating system

It belongs to software, a thing written by humans, virtual existence

What does the operating system provide us : Control scrap copper and rotten iron

Create a file (given to you by the operating system): store data, one character by one

programming language

Is there a difference between programming language and language?

Language: The medium of human-to-human communication

Programming language: The medium of human-computer communication

The role of programming language

Manufacturing operating system

Manufacturing software

python temperature conversion

Code:

< pre class="py">temp = input(‘Please enter the temperature:’) if temp[-1:] ==’C’: F = eval(temp[:-1])*1.8+32 print(F) elif temp[-1:] ==’F’: C = (eval(temp[:-1])-32)/1.8 print(C)

Effect:

Share picture

Code:

 t = input('Please enter the time:')if t[-3:] =='min': m = eval(t[:-3])/1440 print(str(m)+'d')elif t [-1:] =='d': d = eval(t[:-1])*1440 print(str(d)+'min')

Effect:

Share a picture

Note: # S = 123#- 3-2-1# 012# a ='1440min'# print(a[-3:]) #min

day01 practice

The first question : For the string nick handsome, height 180, age 18, weight 140, cut out the height, weight and age of nick in the string

a = ' nick handsome,height 180,age 18,weight 140'print('身Height, weight and age are:'+','+str(a[21:24])+','+str(a[39:])+','+str(a[29:31]) )

Second question: Customize the weight converter, the user may output 70,000g, 140jin, 70000000mg, and the unified output is 140kg

weight = input('Please enter Weight with unit:')if weight[-1:] =='g' and '9' >= weight[-2:-1] >= '0': g = eval(weight[:-1]) /100 print(str(g)+'kg')elif weight[-3:] =='jin': j = eval(weight[:-3])/2 print(str(j)+'kg') elif weight[-2:] =='mg': m = eval(weight[:-2])/1000000 print(str(m)+'kg')else: print('The input format is incorrect! ! ! ')

Question 3: Customized calculator, requirements: input number 1, operator (+-*/), number 2, and perform corresponding operations on number 1 and number 2

a = input('Please enter a number:')b = input('Enter a number again:')c = input('Determine the operation between them:')if c =='+ ': print(eval(a)+eval(b))elif c =='-': print(eval(a)-eval(b))elif c =='*': print(eval(a)*eval (b))elif c =='/': print(eval(a)/eval(b))

Question 4: Construct an age guessing game. Requirements: When the input age is greater than the specified age, output Guessed old; when the input age is less than the specified age, the output guessed small

age = input('Please input age:')a = 20if eval(age)> a: print( 'Guess your age!') elif eval(age) 

Contents

  • What is a computer
  • The history of computer development
  • How to complete our needs through a computer
  • Classification of computers
  • Operating system
  • Programming language
  • Programming The role of language
  • python temperature conversion
  • day01 exercise

  • What is a computer
  • The history of computer development
  • How to complete our needs through computers
  • Classification of computers
  • Operating system
  • Programming language
  • The role of programming language
  • Python temperature conversion
  • day01 practice

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1775 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.