Python Exercise8

September 27, 2017 0

1. Write a program to write all multiple of 7 from 10 to 100 in to a file f=open(‘file1.txt’,’w’) for i in range(14,100,7):  f.write(str(i)+ ‘\n’) Read More

Python Exercise7

September 26, 2017 0

Write a program to read file contents at a time f = open(‘input.txt’,’r’) print(f.read()) f.close()   Write a program to read a file char by Read More

Python Exercise6

September 20, 2017 0

Write a function to read each char from the word if the char matches with the word find the index of that char,store it in indices Read More

Python Exercise5

September 18, 2017 0

Print values from 0 to 10. for i in range(11):     print(i) Print values from 10 to 0  for x in range(10,-1,-1):     print(x) Print Read More

Python Exercise4

September 18, 2017 0

1. Write a program to create list of squares of all odd numbers below 50 and print the list. a=[] for x in range(1,50,2):     Read More

Python Exercises

September 17, 2017 0

Day One Day Two Day Three Day Four Day Five Day Six Day Seven Day Eight Day Nine Day Ten Day Eleven Day Twelve Day Read More

Python Exercise3

September 17, 2017 0

Create an empty dictionary, add four keys and values to the dictionary. Print the keys from the dictionary. dic={} dic[‘O’]=”Oxyzen” dic[‘Ca’]=”Calcium” dic[‘Na’]=”Sodium” dic[‘H’]=”Hydrogen” print(dic) print(dic.keys()) Read More

Python Exercise2

September 17, 2017 0

Write a program to Create a list of strings Sort it Print the last four strings colors=[“Blue”,”Pink”,”Yellow”,”Red”,”White”,”Black”] colors.sort() print(colors) print(colors[-4:])   Write a program to Read More

Python Exercise1

September 16, 2017 0

1.Write a program to take input of name and age from the user and print it Eg: Your name is Ganesh, you are 10 years Read More

1 2 3 4 74