Python
Python
Python
Print Function
Print(”Hello World”)
If you want to have double quotes inside the print function, you can use single quotes to
close the print string
Print(’hello “this” name’)
Input Function
Input(”prompt”) ⟹ Can use this in code now.
💡 If I put the input function inside the print function, the input function is run as it
is required for the print function to move forward.
So print(”Hi “ + INPUT(”What is your name”)) will first display What is your
name? and once the user inputs his name, it will take the name and execute
the print function.
Python 1
Subscripting, you can disect Xth letter by [X-1](As we start from 0)
Data Types
String : A bunch of letters of numbers, that are together. To convert something into a
string, you can use the function str()
Integer: Non Decimal Number
Float: Including Decimal Number
Boolean: Yes or No
You can use variables inside a string by using “f” before starting the string.
Python 2