Coding : Python9 Python_Day 3 Python_Day 3 Conditional Statements, logical operators, code blocks and scope Conditional Statement Conditional statement is if/else. By using If it should be followed with a condition and if it doesn’t it should be changed to else. By using a bathtub as an example we can code as follows: water_level = 50 if water_level > 80: print(“Drain water”) else: print(“continue”) A code for a ticketing bo.. 2023. 11. 15. Python_Day 2 Primitive data types #string = string of characters and need to be created with “”. You can use [ ] to show the first character and use 0 such as print(“Hello”[0]) = H. Even numbers in “ “ will be counted as characters instead of number so print(“123” + “345”) = 12345 #Integer = Makes the code as numbers. With large numbers you can use _ instead of commas to make large numbers more easier to loo.. 2023. 11. 10. Python_Day 1 Printing, commenting, debugging, string Manipulation and variables Printing to the console We use the double quotation marks to indicate that anything in between those quotation marks are not code and just texts to print. These are called strings in programing. The double quotation marks shows the beginning and the end of the string of characters. Print(“Hello world!”) however if you don’t close.. 2023. 11. 10. 이전 1 2 다음