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)