Don't repeat any code! If you do that, there is something wrong. Don't dry (don't repeat yourself) It is a Case-Sensitive language. Keep your variable lower case letters. No space, If you need, use _ . Ex: my_language print ('Hello World') print(f"{kind} kilos ") # kind is a variable which defined before. name= input (' What is your name? ') str: All input are str (default). You need to convert them int or float to make calculation float int ' ' ' You can write whatever you want here ' ' ' word= "Python and Mr.G" print (word[0:4]) ==> Pyth 0 is P. 4 is o. But the last one is excluded. Examples: print (word[2]) ==> t print (word[-1]) ==> G print (word[2:5]) ==> tho print(word[1:-1]) ==> ython and Mr. Function = Methods message.upper() # to convert to uppercase message...
Comments
Post a Comment