i have 10 python programming questions half of the questions.docx

course material

i have 10 python programming questions half of the questions and half of
the programming part i have attached the questions file please go
through it
TASK TWO: OPERATORS AND DECISION MAKING STATEMENT1.Write a program in Python
to perform the following operation:If a number is divisible by 3 it should print
“Consultadd” as a stringIf a number is divisible by 5 it should print “c” as a
stringIf a number is divisible by both 3 and 5 it should print “Consultadd Python
Training― as a string.2. Write a program in Python to perform the following operator
based task:Ask user to choose the following option first:If User Enter 1 – AdditionIf User
Enter 2 – SubtractionIf User Enter 3 – DivisionIf USer Enter 4 – MultiplicationIf User Enter 5
– AverageAsk user to enter the 2 numbers in a variable for first and second for the first 4
options mentioned above.Ask user to enter two more numbers as first1 and second2 for
calculating the average as soon as user choose an option 5.At the end if the answer of any
operation is Negative print a statement saying “zsa―NOTE: At a time user can
perform one action at a time.3. Write a program in Python to implement the given
flowchart:4. Write a program in Python to break and continue if the following cases
occurs:If user enters a negative number just break the loop and print “It’s Over―If
user enters a positive number just continue in the loop and print “Good Going―5.
Write a program in Python which will find all such numbers which are divisible by 7 but are
not a multiple of 5, between 2000 and 3200.6. What is the output of the following code
examples?x=123for i in x:print(i)i = 0while i < 5:print(i)i += 1if i ==
3:breakelse:print(“error―)count = 0while True:print(count)count += 1if count >=
5:Break7. Write a program that prints all the numbers from 0 to 6 except 3 and 6.Expected
output: 0 1 2 4 5Note: Use ‘continue’ statement8. Write a program that accepts a
string as an input from user and calculate the number of digits and letters.Expected output:
consul12Letters 6Digits 29. Read the two parts of the question below:Write a program such
that it asks users to “guess the lucky number―. If the correct number is guessed the
program stops, otherwise it continues forever.Modify the program so that it asks users
whether they want to guess again each time. Use two variables, ‘number’ for the
number and ‘answer’ for the answer to the question whether they want to continue
guessing. The program stops if the user guesses the correct number or answers “no―.
( The program continues as long as a user has not answered “no― and has not
guessed the correct number)10. Write a program that asks five times to guess the lucky
number. Use a while loop and a counter, such ascounter=1While counter <=
5:print(“Type in the”, counter, “number”counter=counter+1The program asks
for five guesses (no matter whether the correct number was guessed or not). If the correct
number is guessed, the program outputs “Good guess!―, otherwise it outputs “Try
again!”. After the fifth guess it stops and prints “Game over!”.11. In the previous
question, insert “break” after the “Good guess!” print statement.
“break― will terminate the while loop so that users do not have to continue guessing
after they found the number. If the user does not guess the number at all, print “Sorry
but that was not very successful―.

Recomendados

Write the program that reads two numbers from the keyboard. It.docx por
Write the program that reads two numbers from the keyboard. It.docxWrite the program that reads two numbers from the keyboard. It.docx
Write the program that reads two numbers from the keyboard. It.docxannetnash8266
2 vistas3 diapositivas
working with loops and if statements working with random numbers Pro.docx por
 working with loops and if statements  working with random numbers Pro.docx working with loops and if statements  working with random numbers Pro.docx
working with loops and if statements working with random numbers Pro.docxajoy21
2 vistas2 diapositivas
Summary In this lab- you complete a prewritten Python program that com.docx por
Summary In this lab- you complete a prewritten Python program that com.docxSummary In this lab- you complete a prewritten Python program that com.docx
Summary In this lab- you complete a prewritten Python program that com.docxStewartt0kJohnstonh
18 vistas2 diapositivas
Number of Questions 111. The Python program below has an erro.docx por
Number of Questions 111. The Python program below has an erro.docxNumber of Questions 111. The Python program below has an erro.docx
Number of Questions 111. The Python program below has an erro.docxdunhamadell
2 vistas4 diapositivas
in c++ Your objective- To write a program that will predict the future.docx por
in c++ Your objective- To write a program that will predict the future.docxin c++ Your objective- To write a program that will predict the future.docx
in c++ Your objective- To write a program that will predict the future.docxmckerliejonelle
3 vistas2 diapositivas
Write a program which repeatedly reads numbers until the user enters.docx por
Write a program which repeatedly reads numbers until the user enters.docxWrite a program which repeatedly reads numbers until the user enters.docx
Write a program which repeatedly reads numbers until the user enters.docxMelvinaLeepercy
3 vistas2 diapositivas

Más contenido relacionado

Similar a i have 10 python programming questions half of the questions.docx

1.Write code that will ask the user to input a 4 digit code say .docx por
1.Write code that will ask the user to input a 4 digit code say .docx1.Write code that will ask the user to input a 4 digit code say .docx
1.Write code that will ask the user to input a 4 digit code say .docxelliotkimberlee
2 vistas3 diapositivas
COMP 122 Entire Course NEW por
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEWshyamuopeight
11 vistas33 diapositivas
Course project solutions 2018 por
Course project solutions 2018Course project solutions 2018
Course project solutions 2018Robert Geofroy
11 vistas29 diapositivas
Cpp Homework Help por
Cpp Homework Help Cpp Homework Help
Cpp Homework Help C++ Homework Help
45 vistas24 diapositivas
If switch structure por
If switch structureIf switch structure
If switch structureM Sagheer Malik
126 vistas3 diapositivas
Question 1- Divisible (5 points in total) Write a C program that promp.pdf por
Question 1- Divisible (5 points in total) Write a C program that promp.pdfQuestion 1- Divisible (5 points in total) Write a C program that promp.pdf
Question 1- Divisible (5 points in total) Write a C program that promp.pdfEvanOZpWallaceq
4 vistas1 diapositiva

Similar a i have 10 python programming questions half of the questions.docx(20)

1.Write code that will ask the user to input a 4 digit code say .docx por elliotkimberlee
1.Write code that will ask the user to input a 4 digit code say .docx1.Write code that will ask the user to input a 4 digit code say .docx
1.Write code that will ask the user to input a 4 digit code say .docx
elliotkimberlee2 vistas
COMP 122 Entire Course NEW por shyamuopeight
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
shyamuopeight11 vistas
Question 1- Divisible (5 points in total) Write a C program that promp.pdf por EvanOZpWallaceq
Question 1- Divisible (5 points in total) Write a C program that promp.pdfQuestion 1- Divisible (5 points in total) Write a C program that promp.pdf
Question 1- Divisible (5 points in total) Write a C program that promp.pdf
EvanOZpWallaceq4 vistas
Student Lab Activity CIS170C Week 6 Lab InstructionsLa.docx por florriezhamphrey3065
Student Lab Activity CIS170C Week 6 Lab InstructionsLa.docxStudent Lab Activity CIS170C Week 6 Lab InstructionsLa.docx
Student Lab Activity CIS170C Week 6 Lab InstructionsLa.docx
Java Practice Set por Gaurav Dixit
Java Practice SetJava Practice Set
Java Practice Set
Gaurav Dixit1.1K vistas
For this and all programming assignments for this course, you are to.docx por denneymargareta
For this and all programming assignments for this course, you are to.docxFor this and all programming assignments for this course, you are to.docx
For this and all programming assignments for this course, you are to.docx
denneymargareta2 vistas
Oop lab assignment 01 por Drjilesh
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
Drjilesh41 vistas
Wellness for LifeName ______________10 Station Workout Plan (.docx por alanfhall8953
Wellness for LifeName ______________10 Station Workout Plan (.docxWellness for LifeName ______________10 Station Workout Plan (.docx
Wellness for LifeName ______________10 Station Workout Plan (.docx
alanfhall89534 vistas
Little book of programming challenges por ysolanki78
Little book of programming challengesLittle book of programming challenges
Little book of programming challenges
ysolanki781.1K vistas
Errors occur in programs, and there are two ways to address the pr.docx por YASHU40
Errors occur in programs, and there are two ways to address the pr.docxErrors occur in programs, and there are two ways to address the pr.docx
Errors occur in programs, and there are two ways to address the pr.docx
YASHU402 vistas
Lab-11-C-Problems.pptx por ShimoFcis
Lab-11-C-Problems.pptxLab-11-C-Problems.pptx
Lab-11-C-Problems.pptx
ShimoFcis6 vistas
Fundamental Concepts of Computing and Programming in Civil and Env por DustiBuckner14
Fundamental Concepts of Computing and Programming in Civil and EnvFundamental Concepts of Computing and Programming in Civil and Env
Fundamental Concepts of Computing and Programming in Civil and Env
DustiBuckner142 vistas
MUST BE IN JAVA PROGRAM PLEASE! Write a Java program that displays a m.docx por LucasmHKChapmant
MUST BE IN JAVA PROGRAM PLEASE! Write a Java program that displays a m.docxMUST BE IN JAVA PROGRAM PLEASE! Write a Java program that displays a m.docx
MUST BE IN JAVA PROGRAM PLEASE! Write a Java program that displays a m.docx
LucasmHKChapmant2 vistas
Chapter 3 branching v4 por Sunarto Quek
Chapter 3 branching v4Chapter 3 branching v4
Chapter 3 branching v4
Sunarto Quek76 vistas
Comp 122 lab 4 lab report and source code por pradesigali1
Comp 122 lab 4 lab report and source codeComp 122 lab 4 lab report and source code
Comp 122 lab 4 lab report and source code
pradesigali172 vistas
Devry cis-170-c-i lab-4-of-7-functions por noahjamessss
Devry cis-170-c-i lab-4-of-7-functionsDevry cis-170-c-i lab-4-of-7-functions
Devry cis-170-c-i lab-4-of-7-functions
noahjamessss9 vistas

Más de scottharry3

What are your thoughts on how the war in Ukraine.docx por
What are your thoughts on how the war in Ukraine.docxWhat are your thoughts on how the war in Ukraine.docx
What are your thoughts on how the war in Ukraine.docxscottharry3
14 vistas1 diapositiva
Step Draft your Goals Begin by reading page.docx por
Step Draft your Goals Begin by reading page.docxStep Draft your Goals Begin by reading page.docx
Step Draft your Goals Begin by reading page.docxscottharry3
5 vistas1 diapositiva
Stock Repurchases In the short article Dutch Shell Finally.docx por
Stock Repurchases In the short article Dutch Shell Finally.docxStock Repurchases In the short article Dutch Shell Finally.docx
Stock Repurchases In the short article Dutch Shell Finally.docxscottharry3
2 vistas1 diapositiva
What common goals did American gay and lesbian.docx por
What common goals did American gay and lesbian.docxWhat common goals did American gay and lesbian.docx
What common goals did American gay and lesbian.docxscottharry3
2 vistas1 diapositiva
While resetting Asus Router you must have to follow.docx por
While resetting Asus Router you must have to follow.docxWhile resetting Asus Router you must have to follow.docx
While resetting Asus Router you must have to follow.docxscottharry3
3 vistas1 diapositiva
What is your biggest nutrition Is it eating.docx por
What is your biggest nutrition Is it eating.docxWhat is your biggest nutrition Is it eating.docx
What is your biggest nutrition Is it eating.docxscottharry3
3 vistas1 diapositiva

Más de scottharry3(20)

What are your thoughts on how the war in Ukraine.docx por scottharry3
What are your thoughts on how the war in Ukraine.docxWhat are your thoughts on how the war in Ukraine.docx
What are your thoughts on how the war in Ukraine.docx
scottharry314 vistas
Step Draft your Goals Begin by reading page.docx por scottharry3
Step Draft your Goals Begin by reading page.docxStep Draft your Goals Begin by reading page.docx
Step Draft your Goals Begin by reading page.docx
scottharry35 vistas
Stock Repurchases In the short article Dutch Shell Finally.docx por scottharry3
Stock Repurchases In the short article Dutch Shell Finally.docxStock Repurchases In the short article Dutch Shell Finally.docx
Stock Repurchases In the short article Dutch Shell Finally.docx
scottharry32 vistas
What common goals did American gay and lesbian.docx por scottharry3
What common goals did American gay and lesbian.docxWhat common goals did American gay and lesbian.docx
What common goals did American gay and lesbian.docx
scottharry32 vistas
While resetting Asus Router you must have to follow.docx por scottharry3
While resetting Asus Router you must have to follow.docxWhile resetting Asus Router you must have to follow.docx
While resetting Asus Router you must have to follow.docx
scottharry33 vistas
What is your biggest nutrition Is it eating.docx por scottharry3
What is your biggest nutrition Is it eating.docxWhat is your biggest nutrition Is it eating.docx
What is your biggest nutrition Is it eating.docx
scottharry33 vistas
When you hear the word what are the first.docx por scottharry3
When you hear the word what are the first.docxWhen you hear the word what are the first.docx
When you hear the word what are the first.docx
scottharry33 vistas
Summary of the type of risk management plan you selected.docx por scottharry3
Summary of the type of risk management plan you selected.docxSummary of the type of risk management plan you selected.docx
Summary of the type of risk management plan you selected.docx
scottharry35 vistas
What is the purpose of the statement of cash.docx por scottharry3
What is the purpose of the statement of cash.docxWhat is the purpose of the statement of cash.docx
What is the purpose of the statement of cash.docx
scottharry36 vistas
When determining how to allocate resources in a hospital how.docx por scottharry3
When determining how to allocate resources in a hospital how.docxWhen determining how to allocate resources in a hospital how.docx
When determining how to allocate resources in a hospital how.docx
scottharry33 vistas
Students will submit a research paper comparing and contrasting 2.docx por scottharry3
Students will submit a research paper comparing and contrasting 2.docxStudents will submit a research paper comparing and contrasting 2.docx
Students will submit a research paper comparing and contrasting 2.docx
scottharry33 vistas
Students must choose 3 Principles Of Technology.docx por scottharry3
Students must choose 3 Principles Of Technology.docxStudents must choose 3 Principles Of Technology.docx
Students must choose 3 Principles Of Technology.docx
scottharry33 vistas
What are some unique challenges we face in the.docx por scottharry3
What are some unique challenges we face in the.docxWhat are some unique challenges we face in the.docx
What are some unique challenges we face in the.docx
scottharry33 vistas
Week 7 Assignment Case Dynamic Pricing Strategies.docx por scottharry3
Week 7 Assignment Case Dynamic Pricing Strategies.docxWeek 7 Assignment Case Dynamic Pricing Strategies.docx
Week 7 Assignment Case Dynamic Pricing Strategies.docx
scottharry37 vistas
Strategic Marketing Metrics The owners of The Westside Coffee.docx por scottharry3
Strategic Marketing Metrics The owners of The Westside Coffee.docxStrategic Marketing Metrics The owners of The Westside Coffee.docx
Strategic Marketing Metrics The owners of The Westside Coffee.docx
scottharry37 vistas
Week 5 ProjectAssignment Due February 14 at PMCourse.docx por scottharry3
Week 5 ProjectAssignment Due February 14 at PMCourse.docxWeek 5 ProjectAssignment Due February 14 at PMCourse.docx
Week 5 ProjectAssignment Due February 14 at PMCourse.docx
scottharry33 vistas
Week 7 Discussion Please separate by discussions as Discussion.docx por scottharry3
Week 7 Discussion Please separate by discussions as Discussion.docxWeek 7 Discussion Please separate by discussions as Discussion.docx
Week 7 Discussion Please separate by discussions as Discussion.docx
scottharry33 vistas
Week 2 ProjectAssignment Due May 10 at AM Initial.docx por scottharry3
Week 2 ProjectAssignment Due May 10 at AM Initial.docxWeek 2 ProjectAssignment Due May 10 at AM Initial.docx
Week 2 ProjectAssignment Due May 10 at AM Initial.docx
scottharry33 vistas
Week 6 Assignment 1 Learning Developing an Employee.docx por scottharry3
Week 6 Assignment 1 Learning Developing an Employee.docxWeek 6 Assignment 1 Learning Developing an Employee.docx
Week 6 Assignment 1 Learning Developing an Employee.docx
scottharry34 vistas
Systematic reviews are an umbrella term for a number of.docx por scottharry3
Systematic reviews are an umbrella term for a number of.docxSystematic reviews are an umbrella term for a number of.docx
Systematic reviews are an umbrella term for a number of.docx
scottharry33 vistas

Último

Class 10 English lesson plans por
Class 10 English  lesson plansClass 10 English  lesson plans
Class 10 English lesson plansTARIQ KHAN
257 vistas53 diapositivas
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx por
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxEIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxISSIP
317 vistas50 diapositivas
Education and Diversity.pptx por
Education and Diversity.pptxEducation and Diversity.pptx
Education and Diversity.pptxDrHafizKosar
118 vistas16 diapositivas
The Open Access Community Framework (OACF) 2023 (1).pptx por
The Open Access Community Framework (OACF) 2023 (1).pptxThe Open Access Community Framework (OACF) 2023 (1).pptx
The Open Access Community Framework (OACF) 2023 (1).pptxJisc
85 vistas7 diapositivas
ICS3211_lecture 08_2023.pdf por
ICS3211_lecture 08_2023.pdfICS3211_lecture 08_2023.pdf
ICS3211_lecture 08_2023.pdfVanessa Camilleri
103 vistas30 diapositivas
Dance KS5 Breakdown por
Dance KS5 BreakdownDance KS5 Breakdown
Dance KS5 BreakdownWestHatch
68 vistas2 diapositivas

Último(20)

Class 10 English lesson plans por TARIQ KHAN
Class 10 English  lesson plansClass 10 English  lesson plans
Class 10 English lesson plans
TARIQ KHAN257 vistas
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx por ISSIP
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxEIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
ISSIP317 vistas
Education and Diversity.pptx por DrHafizKosar
Education and Diversity.pptxEducation and Diversity.pptx
Education and Diversity.pptx
DrHafizKosar118 vistas
The Open Access Community Framework (OACF) 2023 (1).pptx por Jisc
The Open Access Community Framework (OACF) 2023 (1).pptxThe Open Access Community Framework (OACF) 2023 (1).pptx
The Open Access Community Framework (OACF) 2023 (1).pptx
Jisc85 vistas
Dance KS5 Breakdown por WestHatch
Dance KS5 BreakdownDance KS5 Breakdown
Dance KS5 Breakdown
WestHatch68 vistas
Use of Probiotics in Aquaculture.pptx por AKSHAY MANDAL
Use of Probiotics in Aquaculture.pptxUse of Probiotics in Aquaculture.pptx
Use of Probiotics in Aquaculture.pptx
AKSHAY MANDAL89 vistas
Ch. 7 Political Participation and Elections.pptx por Rommel Regala
Ch. 7 Political Participation and Elections.pptxCh. 7 Political Participation and Elections.pptx
Ch. 7 Political Participation and Elections.pptx
Rommel Regala72 vistas
Class 10 English notes 23-24.pptx por TARIQ KHAN
Class 10 English notes 23-24.pptxClass 10 English notes 23-24.pptx
Class 10 English notes 23-24.pptx
TARIQ KHAN107 vistas
Are we onboard yet University of Sussex.pptx por Jisc
Are we onboard yet University of Sussex.pptxAre we onboard yet University of Sussex.pptx
Are we onboard yet University of Sussex.pptx
Jisc77 vistas
The Accursed House by Émile Gaboriau por DivyaSheta
The Accursed House  by Émile GaboriauThe Accursed House  by Émile Gaboriau
The Accursed House by Émile Gaboriau
DivyaSheta158 vistas
Classification of crude drugs.pptx por GayatriPatra14
Classification of crude drugs.pptxClassification of crude drugs.pptx
Classification of crude drugs.pptx
GayatriPatra1477 vistas
Narration ppt.pptx por TARIQ KHAN
Narration  ppt.pptxNarration  ppt.pptx
Narration ppt.pptx
TARIQ KHAN119 vistas
Psychology KS4 por WestHatch
Psychology KS4Psychology KS4
Psychology KS4
WestHatch68 vistas
Community-led Open Access Publishing webinar.pptx por Jisc
Community-led Open Access Publishing webinar.pptxCommunity-led Open Access Publishing webinar.pptx
Community-led Open Access Publishing webinar.pptx
Jisc74 vistas
11.28.23 Social Capital and Social Exclusion.pptx por mary850239
11.28.23 Social Capital and Social Exclusion.pptx11.28.23 Social Capital and Social Exclusion.pptx
11.28.23 Social Capital and Social Exclusion.pptx
mary850239281 vistas
Scope of Biochemistry.pptx por shoba shoba
Scope of Biochemistry.pptxScope of Biochemistry.pptx
Scope of Biochemistry.pptx
shoba shoba124 vistas
AI Tools for Business and Startups por Svetlin Nakov
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and Startups
Svetlin Nakov101 vistas
Structure and Functions of Cell.pdf por Nithya Murugan
Structure and Functions of Cell.pdfStructure and Functions of Cell.pdf
Structure and Functions of Cell.pdf
Nithya Murugan368 vistas

i have 10 python programming questions half of the questions.docx

  • 1. i have 10 python programming questions half of the questions and half of the programming part i have attached the questions file please go through it TASK TWO: OPERATORS AND DECISION MAKING STATEMENT1.Write a program in Python to perform the following operation:If a number is divisible by 3 it should print “Consultadd” as a stringIf a number is divisible by 5 it should print “c” as a stringIf a number is divisible by both 3 and 5 it should print “Consultadd Python Training― as a string.2. Write a program in Python to perform the following operator based task:Ask user to choose the following option first:If User Enter 1 – AdditionIf User Enter 2 – SubtractionIf User Enter 3 – DivisionIf USer Enter 4 – MultiplicationIf User Enter 5 – AverageAsk user to enter the 2 numbers in a variable for first and second for the first 4 options mentioned above.Ask user to enter two more numbers as first1 and second2 for calculating the average as soon as user choose an option 5.At the end if the answer of any operation is Negative print a statement saying “zsa―NOTE: At a time user can perform one action at a time.3. Write a program in Python to implement the given flowchart:4. Write a program in Python to break and continue if the following cases occurs:If user enters a negative number just break the loop and print “It’s Over―If user enters a positive number just continue in the loop and print “Good Going―5. Write a program in Python which will find all such numbers which are divisible by 7 but are not a multiple of 5, between 2000 and 3200.6. What is the output of the following code examples?x=123for i in x:print(i)i = 0while i < 5:print(i)i += 1if i == 3:breakelse:print(“error―)count = 0while True:print(count)count += 1if count >= 5:Break7. Write a program that prints all the numbers from 0 to 6 except 3 and 6.Expected output: 0 1 2 4 5Note: Use ‘continue’ statement8. Write a program that accepts a string as an input from user and calculate the number of digits and letters.Expected output: consul12Letters 6Digits 29. Read the two parts of the question below:Write a program such that it asks users to “guess the lucky number―. If the correct number is guessed the program stops, otherwise it continues forever.Modify the program so that it asks users whether they want to guess again each time. Use two variables, ‘number’ for the number and ‘answer’ for the answer to the question whether they want to continue guessing. The program stops if the user guesses the correct number or answers “no―. ( The program continues as long as a user has not answered “no― and has not guessed the correct number)10. Write a program that asks five times to guess the lucky
  • 2. number. Use a while loop and a counter, such ascounter=1While counter <= 5:print(“Type in the”, counter, “number”counter=counter+1The program asks for five guesses (no matter whether the correct number was guessed or not). If the correct number is guessed, the program outputs “Good guess!―, otherwise it outputs “Try again!”. After the fifth guess it stops and prints “Game over!”.11. In the previous question, insert “break” after the “Good guess!” print statement. “break― will terminate the while loop so that users do not have to continue guessing after they found the number. If the user does not guess the number at all, print “Sorry but that was not very successful―.