SlideShare a Scribd company logo
1 of 2
Python Practice Problems
                                K. Narsimlu (IT-Mentor)

Python Practice Problems: (Simple Programs)

In the following problems use input command. Ask the user to enter ‘a’ and ‘b’ values
and you have to find out ‘c’ value (use raw_input to get input data from key board):

1. Write a Python Program to print the following values
      a. Ex1: a=2, b=3, output c=5
      b. Ex2: a=45, b=80, output c=125
2. Write a Python Program to concatenate twostrings
      a. Ex1: string1=RGUKT string2=Basar, resultc=RGUKTBasar
3. Write a Python Program to print the following values
      a. Ex1: a=7, b=4 output c=65
      b. Ex2: a=8, b=2 output c=68
4. Write a Python Program to print the following values
      a. Ex1: a= 45, b=6 output c=3
      b. Ex1: a=11, b=2 output c=1
5. Write a Python Program to print the following values
      a. Ex1: a=225, b=15 output c=15
      b. Ex2: a=41 , b=5 output c=8
6. Write a Python Program to print the following values
      a. Ex1: a=7, b=8 output c=225
      b. Ex1: a=15, b=30 output c=2025
7. Write a Python Program to print the following values
      a. Ex1: a=113 output is 10.63
      b. Ex2: a=55 output is 7.41
8. Write a Python Program to print the following values
      a. Ex1: a=45 b=114 output is a=114, b=45
9. Write a Python Program to print the following values
      a. Ex1: a=345, b=230 output c = 460
      b. Ex2: a=45, b=330 output c = 660
10. Design your own signature logo and print it followed by “yours truly—your name.”
      a. A signature logo might look like
Python Practice Problems
                                  K. Narsimlu (IT-Mentor)



Complex Programs:

  1. Write a Python Program to ask the user to enter one integer. If the entered number
     is even. Print the given number is even or Print the given number is odd
  2.   Write a Python Program to ask the user to enter his age. If the age is greater than
       or equals to 18 then print a message “He/ she is a major”. If the age is less than
       18, then print a message that “he/she is minor”.
  3. Write a Python Program to ask the user to enter two numbers. And find out the bigger
     number. Ex: number1=50, number2=100. The output should be “Number2 is bigger”. If
     the two numbers are equal , print a message that “Two numbers are equal”
  4. Write a program, ask for the user to enter five integer values and calculate the average.
  5. You have a green lottery ticket, with ints a, b, and c on it. If the numbers are all
     different from each other, the result is 0. If all of the numbers are the same, the
     result is 20. If two of the numbers are the same, the result is 10.

                    TestCases:
                    greenTicket(1,2,3)→0
                    greenTicket(2,2,2)→20
                    greenTicket(1, 1, 2) →10

More Related Content

What's hot

Job opportunities for electronics engineering
Job opportunities for electronics engineeringJob opportunities for electronics engineering
Job opportunities for electronics engineeringVikas Dongre
 
serb brochure workshop
serb brochure workshopserb brochure workshop
serb brochure workshopArunkumar51940
 
Brain-Computer Interface (BCI)-Seminar Report
Brain-Computer Interface (BCI)-Seminar ReportBrain-Computer Interface (BCI)-Seminar Report
Brain-Computer Interface (BCI)-Seminar Reportjosnapv
 
Protocols for internet of things
Protocols for internet of thingsProtocols for internet of things
Protocols for internet of thingsCharles Gibbons
 
Door lock-using-rfid-technology
Door lock-using-rfid-technology Door lock-using-rfid-technology
Door lock-using-rfid-technology Ho Vu
 
Research perspectives in biomedical signal processing
Research perspectives in biomedical signal processingResearch perspectives in biomedical signal processing
Research perspectives in biomedical signal processingajayhakkumar
 
iot industry automation
iot industry automationiot industry automation
iot industry automationmansi sharma
 
Temperature control Switch and Display By Led
Temperature control Switch and Display By LedTemperature control Switch and Display By Led
Temperature control Switch and Display By LedCOMSATS Abbottabad
 
Brain computer interfaces
Brain computer interfacesBrain computer interfaces
Brain computer interfacespavanireddy86
 
Home automation voice control
Home automation voice controlHome automation voice control
Home automation voice controlAhammednayeem
 
Quality attributes(Non operational) of embedded systems
Quality attributes(Non operational) of embedded systemsQuality attributes(Non operational) of embedded systems
Quality attributes(Non operational) of embedded systemsShreyaBhoje
 
SMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATIONSMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATIONEklavya Sharma
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoVishnu
 
Seminar on field programmable gate array
Seminar on field programmable gate arraySeminar on field programmable gate array
Seminar on field programmable gate arraySaransh Choudhary
 
FILTER DESIGN
FILTER DESIGNFILTER DESIGN
FILTER DESIGNnaimish12
 

What's hot (20)

Job opportunities for electronics engineering
Job opportunities for electronics engineeringJob opportunities for electronics engineering
Job opportunities for electronics engineering
 
serb brochure workshop
serb brochure workshopserb brochure workshop
serb brochure workshop
 
Brain-Computer Interface (BCI)-Seminar Report
Brain-Computer Interface (BCI)-Seminar ReportBrain-Computer Interface (BCI)-Seminar Report
Brain-Computer Interface (BCI)-Seminar Report
 
Protocols for internet of things
Protocols for internet of thingsProtocols for internet of things
Protocols for internet of things
 
Door lock-using-rfid-technology
Door lock-using-rfid-technology Door lock-using-rfid-technology
Door lock-using-rfid-technology
 
Embedded System
Embedded SystemEmbedded System
Embedded System
 
Arduino
ArduinoArduino
Arduino
 
Research perspectives in biomedical signal processing
Research perspectives in biomedical signal processingResearch perspectives in biomedical signal processing
Research perspectives in biomedical signal processing
 
Fpaa 1
Fpaa 1Fpaa 1
Fpaa 1
 
iot industry automation
iot industry automationiot industry automation
iot industry automation
 
Temperature control Switch and Display By Led
Temperature control Switch and Display By LedTemperature control Switch and Display By Led
Temperature control Switch and Display By Led
 
Smart Blind stick by using arduino uno and sensor
 Smart Blind stick  by using arduino  uno  and sensor Smart Blind stick  by using arduino  uno  and sensor
Smart Blind stick by using arduino uno and sensor
 
Brain computer interfaces
Brain computer interfacesBrain computer interfaces
Brain computer interfaces
 
Home automation voice control
Home automation voice controlHome automation voice control
Home automation voice control
 
Quality attributes(Non operational) of embedded systems
Quality attributes(Non operational) of embedded systemsQuality attributes(Non operational) of embedded systems
Quality attributes(Non operational) of embedded systems
 
Decimation in Time
Decimation in TimeDecimation in Time
Decimation in Time
 
SMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATIONSMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATION
 
Arduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic ArduinoArduino Workshop Day 1 - Basic Arduino
Arduino Workshop Day 1 - Basic Arduino
 
Seminar on field programmable gate array
Seminar on field programmable gate arraySeminar on field programmable gate array
Seminar on field programmable gate array
 
FILTER DESIGN
FILTER DESIGNFILTER DESIGN
FILTER DESIGN
 

Similar to Python programs

COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEWshyamuopeight
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsjody zoll
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsshyaminfo04
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsash52393
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy BookAbir Hossain
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2Animesh Chaturvedi
 
Cis 170 c ilab 5 of 7 arrays and strings
Cis 170 c ilab 5 of 7 arrays and stringsCis 170 c ilab 5 of 7 arrays and strings
Cis 170 c ilab 5 of 7 arrays and stringsCIS321
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsnoahjamessss
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringscskvsmi44
 
Sample Program file class 11.pdf
Sample Program file class 11.pdfSample Program file class 11.pdf
Sample Program file class 11.pdfYashMirge2
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans incnayakq
 
1 ECE 175 Computer Programming for Engineering Applica.docx
1  ECE 175 Computer Programming for Engineering Applica.docx1  ECE 175 Computer Programming for Engineering Applica.docx
1 ECE 175 Computer Programming for Engineering Applica.docxoswald1horne84988
 
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
Week 2PRG 218   Variables and Input and Output OperationsWrite.docxWeek 2PRG 218   Variables and Input and Output OperationsWrite.docx
Week 2PRG 218 Variables and Input and Output OperationsWrite.docxmelbruce90096
 
programming for programs solving using C language
programming for  programs solving using C languageprogramming for  programs solving using C language
programming for programs solving using C languagesushma chinta
 

Similar to Python programs (20)

COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and strings
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and strings
 
Devry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and stringsDevry cis 170 c i lab 5 of 7 arrays and strings
Devry cis 170 c i lab 5 of 7 arrays and strings
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
 
C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2C - Programming Assignment 1 and 2
C - Programming Assignment 1 and 2
 
17 Jo P May 08
17 Jo P May 0817 Jo P May 08
17 Jo P May 08
 
Cis 170 c ilab 5 of 7 arrays and strings
Cis 170 c ilab 5 of 7 arrays and stringsCis 170 c ilab 5 of 7 arrays and strings
Cis 170 c ilab 5 of 7 arrays and strings
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
Cp manual final
Cp manual finalCp manual final
Cp manual final
 
Java Practice Set
Java Practice SetJava Practice Set
Java Practice Set
 
Sample Program file class 11.pdf
Sample Program file class 11.pdfSample Program file class 11.pdf
Sample Program file class 11.pdf
 
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORYGE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
GE3171-PROBLEM SOLVING AND PYTHON PROGRAMMING LABORATORY
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans inc
 
1 ECE 175 Computer Programming for Engineering Applica.docx
1  ECE 175 Computer Programming for Engineering Applica.docx1  ECE 175 Computer Programming for Engineering Applica.docx
1 ECE 175 Computer Programming for Engineering Applica.docx
 
Cpp Homework Help
Cpp Homework Help Cpp Homework Help
Cpp Homework Help
 
ADLAB.pdf
ADLAB.pdfADLAB.pdf
ADLAB.pdf
 
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
Week 2PRG 218   Variables and Input and Output OperationsWrite.docxWeek 2PRG 218   Variables and Input and Output OperationsWrite.docx
Week 2PRG 218 Variables and Input and Output OperationsWrite.docx
 
programming for programs solving using C language
programming for  programs solving using C languageprogramming for  programs solving using C language
programming for programs solving using C language
 

Recently uploaded

How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 

Recently uploaded (20)

How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 

Python programs

  • 1. Python Practice Problems K. Narsimlu (IT-Mentor) Python Practice Problems: (Simple Programs) In the following problems use input command. Ask the user to enter ‘a’ and ‘b’ values and you have to find out ‘c’ value (use raw_input to get input data from key board): 1. Write a Python Program to print the following values a. Ex1: a=2, b=3, output c=5 b. Ex2: a=45, b=80, output c=125 2. Write a Python Program to concatenate twostrings a. Ex1: string1=RGUKT string2=Basar, resultc=RGUKTBasar 3. Write a Python Program to print the following values a. Ex1: a=7, b=4 output c=65 b. Ex2: a=8, b=2 output c=68 4. Write a Python Program to print the following values a. Ex1: a= 45, b=6 output c=3 b. Ex1: a=11, b=2 output c=1 5. Write a Python Program to print the following values a. Ex1: a=225, b=15 output c=15 b. Ex2: a=41 , b=5 output c=8 6. Write a Python Program to print the following values a. Ex1: a=7, b=8 output c=225 b. Ex1: a=15, b=30 output c=2025 7. Write a Python Program to print the following values a. Ex1: a=113 output is 10.63 b. Ex2: a=55 output is 7.41 8. Write a Python Program to print the following values a. Ex1: a=45 b=114 output is a=114, b=45 9. Write a Python Program to print the following values a. Ex1: a=345, b=230 output c = 460 b. Ex2: a=45, b=330 output c = 660 10. Design your own signature logo and print it followed by “yours truly—your name.” a. A signature logo might look like
  • 2. Python Practice Problems K. Narsimlu (IT-Mentor) Complex Programs: 1. Write a Python Program to ask the user to enter one integer. If the entered number is even. Print the given number is even or Print the given number is odd 2. Write a Python Program to ask the user to enter his age. If the age is greater than or equals to 18 then print a message “He/ she is a major”. If the age is less than 18, then print a message that “he/she is minor”. 3. Write a Python Program to ask the user to enter two numbers. And find out the bigger number. Ex: number1=50, number2=100. The output should be “Number2 is bigger”. If the two numbers are equal , print a message that “Two numbers are equal” 4. Write a program, ask for the user to enter five integer values and calculate the average. 5. You have a green lottery ticket, with ints a, b, and c on it. If the numbers are all different from each other, the result is 0. If all of the numbers are the same, the result is 20. If two of the numbers are the same, the result is 10. TestCases: greenTicket(1,2,3)→0 greenTicket(2,2,2)→20 greenTicket(1, 1, 2) →10