UCEST 105 Lab Cycle - 1

Learning outcome:
Understand Different Data Types and type conversions.
Explore input() and print() statement.
Apply the operators ( arithmetic, relational ,logical , bitwise and membership operators) and explore precedence and associativity.
Learn to import packages and use various functions.
Apply if-else, if-elif and match-case statements.
Learn to use strings and string functions in python

Understand various primitive data types used in Python by creating variables of different data type and print their type using type() function before trying the programs.

1. Implement Simple desktop calculator using Python. ( learn arithmetic operators, membership operators and  if,  if-elif statement, do the program using match case)
2. Create, concatenate, and print a string and access a sub-string from a given string. ( learn string, string operators)
3. Familiarize time and date in various formats (Eg. “Thu Jul 11 10:26:23 IST 2024”).( learn to use package)
Print the current date in the following format 
12/09/2020
September 12, 2020
Print the current time in H:M:S format
Print the current month calendar ( use calendar package)
4. Program to find the largest of three numbers. ( learn logical operators and, or, not )
5.Check whether the given number is divisible by 3 and 7.( learn % operator and logical and)
6. Convert temperature values back and forth between Celsius (C), and Fahrenheit (F). [Formula: °C = (°F - 32) × 5/9] ( learn to write arithmetic expression- understand the precedence and associativity)
7.Find the binary, octal and hex equivalent of a decimal number ( learn about built-in functions)
8.Compute nCr. Read 'n' and 'r' and use the math package to find the factorial. ( learn to use packages)
9.Write a Python script to find the area of a circle. Read 'r' ( float). Print the area rounded to 2 decimal places. ( Use math package to get the value of PI .learn to use print formatting)
10.Write a Python program to find the roots of a quadratic equation ( ax^2+bx+c=0)
11.Count how many digits are there in the factorial of 1000, also find how many zeros are there. (learn to use string function count() and type conversion)
12.Check whether the given string is palindrome.( learn slicing )
13.Check whether the given character is a vowel character ( learn membership operator 'in')
14.Check whether the given character is alphabet or digit ( learn string functions isdigit() isalpha())
15.
Read mark out-of 100 and the program must print the KTU Grade and Grade Point. ( learn nested if)

Note: Add proper comments and documentation to the program. You must also write algorithm, flowchart and pseudo code for qno:4,5,6,7,8,9,10.

Supplementary  Programs: ( Learn and do)
1.In a circle, a square with side length '2a' is inscribed. What is the area of the circle?Input 'a'.

2.Write a Program that takes the lengths of three sides of a triangle as input and determine whether the triangle is equilateral, isosceles or scalene.

3.Write a program to check if a given year is a leap year or not. A leap year is divisible by 4 but not by 100, except when its divisible by 400.

4.Read a string s1. Read another string s2.Repeat s2 3 times.Concatenate both s1 and s2 with space character as separator into s3. ( learn string operators)
Eg:s1=model  s2=mec s3=model mecmecmec
Replace m with 'M'
s3=Model MecMecMec
Count number of 'M'
4

5.Read an 8bit binary number as string and slice the 4 bits separately and print the hex value of each.
input x='10111100'
output 0x0b 0x0c

6.Check whether the given number is even or odd ( use bitwise  & operator )

Comments

Popular posts from this blog

Algorithmic Thinking with Python UCEST 105- KTU First Semester BTech Course 2024 scheme notes pdf - Dr Binu V P 9847390760

Lab Experiments and Solutions - Algorithmic thinking with Python KTU S1 2024 scheme