Home > other >  Python
Python

Time:09-24

Save the children?????? Thank you, urgent urgent thank

CodePudding user response:

 
Message="go to bed early every day, have no matter to play less mobile, bad for mobile phones'
# 1
Print (message. Replace (' mobile phone ', 'computer'))
# 2
Print (message. The split (', '))
# 3
Print (message [13]) starting from 0 # index
# 4
Print (message [5])
# 5
Print (message [- 5:])
# 6
Print (message. The index (' ok '))

CodePudding user response:

Come on, children are basic
2.
 
V1=1
V2=1
For I in range (365) :
V1 +=0.01
V2 -=0.01
Print (v1)
Print (v2)
Print (v1, v2)

3.
 

Height=float (input (" please enter the height m: "))
Weight=float (input (" please enter the weight KG: "))

Bmi=weight/height * * 2)
Print (bmi)
If bmi & lt; 18.5:
Print (' lean ')
Elif 18.5 & gt;=bmi and bmi & lt;=23.9:
Print (' normal ')
Elif 24 & gt;=bmi and bmi & lt;=26.9:
Print (" fat ")
Elif 27 & gt;=bmi and bmi & lt;=29.9:
Print (" obesity ")
Elif bmi & gt;=30:
Print (' severe obesity)

4.
 
Famous_person=[' Newton ', 'Confucius',' he ', 'Einstein']
Print (len (famous_person))
Famous_person. Append (' Darwin ')
Print (famous_person)
Famous_person. Insert (0, 'qin')
Print (famous_person)
Famous_person [1]='mozi'
Print (famous_person)
Famous_person. Remove (' Einstein ')
Print (famous_person)
Value3=famous_person. Pop (2)
Print (value3)

5.
 
Boss={' name ':' thanos', 'power', '100', 'skills: [' strong', 'fast', 'glove']}
For the key in boss. Keys () :
Print (key)

For the value in boss. Values () :
Print (value)

For the key, the value in boss. The items () :
Print (key, value)

Boss [' speed ']="80"
Print (boss)

Boss [' power ']='90'
Print (boss)

The boss [' skills']. Append (' purple ')
Print (boss)

CodePudding user response:

Remember "stickers for kids,

CodePudding user response:

refer to the second floor smiled program monkey reply:
cheer, children are basic
2.
 
V1=1
V2=1
For I in range (365) :
V1 +=0.01
V2 -=0.01
Print (v1)
Print (v2)
Print (v1, v2)

3.
 

Height=float (input (" please enter the height m: "))
Weight=float (input (" please enter the weight KG: "))

Bmi=weight/height * * 2)
Print (bmi)
If bmi & lt; 18.5:
Print (' lean ')
Elif 18.5 & gt;=bmi and bmi & lt;=23.9:
Print (' normal ')
Elif 24 & gt;=bmi and bmi & lt;=26.9:
Print (" fat ")
Elif 27 & gt;=bmi and bmi & lt;=29.9:
Print (" obesity ")
Elif bmi & gt;=30:
Print (' severe obesity)

4.
 
Famous_person=[' Newton ', 'Confucius',' he ', 'Einstein']
Print (len (famous_person))
Famous_person. Append (' Darwin ')
Print (famous_person)
Famous_person. Insert (0, 'qin')
Print (famous_person)
Famous_person [1]='mozi'
Print (famous_person)
Famous_person. Remove (' Einstein ')
Print (famous_person)
Value3=famous_person. Pop (2)
Print (value3)

5.
 
Boss={' name ':' thanos', 'power', '100', 'skills: [' strong', 'fast', 'glove']}
For the key in boss. Keys () :
Print (key)

For the value in boss. Values () :
Print (value)

For the key, the value in boss. The items () :
Print (key, value)

Boss [' speed ']="80"
Print (boss)

Boss [' power ']='90'
Print (boss)

The boss [' skills']. Append (' purple ')
Print (boss)

The second question should be take is equal to 1.01, take is equal to 0.99

CodePudding user response:

Kechuang teenager. Sweet old silk. Teenagers python. Scratch kechuang young teenagers. Sweet old silk. Teenagers python. Scratch kechuang young teenagers. Sweet old silk. Teenagers python. The Scratch
Quite good, thank you learned

CodePudding user response:

# 1

Message="sleep early every night, nothing less to play mobile phone, is not good for mobile phone"
Print (message. Replace (' mobile phone ', 'computer'))
Arr=message. The split (', ')
For I in arr:
Print (I)
Print (message [13])
Print (message [5])
Print (message [- 5:])
Print (message. The find (' ok '))

# 2
Res1=res2=1.0
For I in range (0, 365) :
Res1 *=1.01
Res2 *=0.99
Print (" 365 days of your learning ability for the original %. 2 f % of your learning ability for 365 days, 2 f "% (res1 and res2))

# 4
Famous_person=[" Newton "and" Confucius ", "thin", "Einstein"]
Print (" list of length: % d % len (famous_person))
Famous_person. Append (" Darwin ")
Print (famous_person)
Famous_person. Insert (0, "qin shi huang")
Print (famous_person)
Famous_person [1]="mozi"
Print (famous_person)
Famous_person. Remove (" Einstein ")
Print (famous_person)
Tem=famous_person [2]
Famous_person. Pop (2)
Print (tem)
Print (famous_person)
Famous_person. Reverse ()
Print (famous_person)

# 5
Boss={' name ':' thanos', 'power', '100', 'skills' :' [" strong ", "fast", "glove"] '}
For the key in boss:
Print (key + ":", the boss [key])
Boss. The update (speed=80)
Print (boss)
Boss. The update (power=90)
Print (boss)
nullnullnullnullnull