Write a program to print all the squares of the range from 1 to n.
Input:
Get the Value
Output:
Display the square value of the dictionary
INPUT
5
OUTPUT
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
dict={} a=int(input("Value: ")) for i in range(1,a+1): dict[i]=i**2 print(dict)
INPUT_1:
Value: 5
OUTPUT:
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
INPUT_2:
Value: 6
OUTPUT:
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36}
INPUT_3:
Value: 8
OUTPUT:
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64}
INPUT_4:
Value: 9
OUTPUT:
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81}
INPUT_5:
Value: 10
OUTPUT:
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81, 10: 100}
ILLUSTRATION
Morae Q!
- OS operating system module using path parameter.
- Find the smallest and largest integers after sorting using bubble sort.
- Find the integer and its number of occurrences.
- Algorithm complexity – Big O Notation with Examples.
- Linear search.
- Map module using series mapping and parallel mapping.
- Mapping and Transposing with Map Module.
- Map Module/built-in Function.
- Linux commands for managing files.
- Program which takes two lists and maps two lists into a dictionary.
- Splitting strings and substituting using regular expressions regex.
- Basics of regular expression Regex.
- Find the square value of the dictionary.
- Check whether the given key is present in the dictionary.
- Matching an expression only in specific places using regular expressions.
- Escaping special characters using regular expressions.
- Check the key.
- Grouping and sub-grouping using regular expressions.
- Generate a Dictionary that Contains Numbers in the Form (x , x*x).
- Algorithm complexity Big-Theta, Big-Omega and Big-O Notations.