If you dont know how to run python in vs code you should click here
- To comment a line use
#
- Multiline comment use
""" comment """
- Assign value in variable
variable_name = value
- To display use
print()
Example - To scan value from user use
input()
Example
- To use if condition use
if condition : code else: code
Example - To use else if condition or nested if use
if condition: code elif condition: code else: code
Example
- To use for loop use
for variable_name in array_name: print(variable_name)
Example
- Declear String
string_name = "string"
Example - Print String
print(string_name)
Example - Print targeted letter numbers in string
string_name.count('target_letter')
Example - Check length of the string
len(string_name)
Example - Print string in customise way
string_name[start:end:difference]
Example
- Write a Python program which accepts the radius of a circle from the user and compute the area
- Write a Python program which accepts the user's first and last name and print them in reverse order with a space between them
- Write a Python program to display the first and last colours from the following list: color_list = ["Red","Green","White" ,"Black"]
- Write a Python program that accepts an integer (n) and computes the value of n+nn+nnn.
Hello guys hope you will like to contribute in this repository for python short notes. Your any types of contribution is acceptable so contribute. And if you like this repository then dont forget to give a star.