Skip to content

Ogbus/pythoncodes

Repository files navigation

pythoncodes

computer Exercises - Day 1 Check the python version you are using Open the python interactive shell and do the following operations. The operands are 3 and 4. Check the example above addition(+) subtraction(-) multiplication(*) modulus(%) division(/) exponential(**) floor division operator(//) Write strings on the python interactive shell. The strings are the following: Your name Your family name Your country I am enjoying 30 days of python Check the data types of the following data: 10 9.8 3.14 4 - 4j ['Asabeneh', 'Python', 'Finland'] Your name Your family name Your country Create a folder name day_1 inside 30DaysOfPython folder. Inside day_1 folder, create a file python file helloword.py and repeat question 1, 2, 3 and 4. Remember to use print() when you are working on a python file. Navigate to the directory where you saved your file, and run it.

computer Exercises - Day 2 Inside 30DaysOfPython create a folder called day_2. Inside this folder create a file name called variables.py Writ a python comment saying 'Day 2: 30 Days of python programming' Declare a first name variable and assign a value to it Declare a last name variable and assign a value to it Declare a full name variable and assign a value to it Declare a country variable and assign a value to it Declare a city variable and assign a value to it Declare an age variable and assign a value to it Declare a year variable and assign a value to it Declare a variable is_married and assign a value to it Declare a variable is_true and assign a value to it Declare a variable is_light_on and assign a value to it Declare multiple variable on one line Check the data type of all your variables using type() built in function Using the len() built-in function find the length of your first name Compare the length of your first name and your last name Declare 5 as num_one and 4 as num_two Add num_one and num_two and assign the value to a variable total Subtract num_two from num_one and assign the value to a variable diff Multiply num_two and num_one and assign the value to a variable product Divide num_one by num_two and assign the value to a variable division Use modulus division to find num_two divided by num_one and assign the value to a variable remainder Calculate num_one the power of num_two and assign the value to a variable exp Find floor division of num_one by num_two and assign the value to a variable floor_division The radius of a circle is 30 meters. Calculate the area of a circle and assign the value to a variable area_of_circle Calculate the circumference of a circle and assign the value to a variable circum_of_circle Take radius as user input and calculate the area. Use the built-in input function to get first name, last name, country and age from a user and store the value to their corresponding variable names Run help('keywords') on python shell or in your file check the reserved words

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published