Snakify Python Program Solution Input Print and Numbers | Chetan TM
Loading ...

Snakify Python Program Solution Input Print and Numbers

SHARE:

Tutor Chetan

Python - Programming Language

Snakify.org - Problem Solution

Input, Print and Number

Useful Links:

1)    Sum of three numbers

Statement

Write a program that takes three numbers and prints their sum. Every number is given on a separate line.


Model solution

  • a = int(input())
  • b = int(input())
  • c = int(input())
  • print(a + b + c)

 

2)    Hi John

Statement

Write a program that greets the person by printing the word "Hi" and the name of the person. See the examples below.

Model solution

  • # Read the name:
  • name = input()
  • # Print the result using
  • print('Hi', name)

 

3)    Square

Statement

Write a program that takes a number and print its square.

Model solution

  • a = int(input())
  • print(a ** 2)

 

4)Area of right-angled triangle

Statement

Write a program that reads the length of the base and the height of a right-angled triangle and prints the area. Every number is given on a separate line.

Model solution

  • a = int(input())
  • b = int(input())
  • print(a * b / 2)


5)  Hello, Harry!

Statement

Write a program that greets the user by printing the word "Hello", a comma, the name of the user and an exclamation mark after it. See the examples below.


Warning. Your program's output should strictly match the desired one, character by character. There shouldn't be any space between the name and the exclamation mark. You can use + operator to concatenate two strings. See the lesson for details.

Model solution

  • print('Hello, ' + input() + '!')


6)  Apple sharing

Statement

N students take K apples and distribute them among each other evenly. The remaining (the undivisible) part remains in the basket. How many apples will each single student get? How many apples will remain in the basket?


The program reads the numbers N and K. It should print the two answers for the questions above.

Model solution

  • n = int(input())
  • k = int(input())
  • print(k // n)
  • print(k % n)


7)    Previous and next

Statement

Write a program that reads an integer number and prints its previous and next numbers. See the examples below for the exact format your answers should take. There shouldn't be a space before the period.


Remember that you can convert the numbers to strings using the function str.

Model solution

  • n = int(input())
  • print('The next number for the number ' + str(n) + ' is ' + str(n + 1) + '.')
  • print('The previous number for the number ' + str(n) + ' is ' + str(n - 1) + '.')

 

8)    Two timestamps

Statement

A timestamp is three numbers: a number of hours, minutes and seconds. Given two timestamps, calculate how many seconds is between them. The moment of the first timestamp occurred before the moment of the second timestamp.


Model solution

  • hours_1 = int(input())
  • minutes_1 = int(input())
  • seconds_1 = int(input())
  • hours_2 = int(input())
  • minutes_2 = int(input())
  • seconds_2 = int(input())
  • print(hours_2 * 3600 + minutes_2 * 60 + seconds_2 - hours_1 * 3600 - minutes_1 * 60 - seconds_1)

 

9)    School desks

Statement

A school decided to replace the desks in three classrooms. Each desk sits two students. Given the number of students in each class, print the smallest possible number of desks that can be purchased.


The program should read three integers: the number of students in each of the three classes, ab and c respectively.

In the first test there are three groups. The first group has 20 students and thus needs 10 desks. The second group has 21 students, so they can get by with no fewer than 11 desks. 11 desks is also enough for the third group of 22 students. So we need 32 desks in total.

Model solution

  • a = int(input())
  • b = int(input())
  • c = int(input())
  • print(a // 2 + b // 2 + c // 2 + a % 2 + b % 2 + c % 2)

COMMENTS

Contact 9816585747 for Advertisement
Name

#Facebookdown,2,#InstagramDown,2,#Messengerdown,1,#WhatsAppdown,2,A-Class-Banks-in-Nepal,5,ADBL,8,ADBL-Vacancy,1,AdobePhotoshop,7,Advertisement,6,Africa,3,Agricultural-Development-Bank-Limited,1,Agricultural-Development0Bank-ADBL-Model-Question,1,AIMS-Hospital-and-Cancer-Center-Vacancy-for-Various-Health-Services,1,APF-Nepal-Final-Exam-Result,4,APF-Nepal-Medical-Exam-Result,4,APF-Nepal-Physical-Exam-Result,2,APF-Nepal-Promotion-Recommend-List,3,APF-Nepal-Salary,1,APF-Nepal-Vacancy-2078,2,APF-Nepal-Written-Exam-Result,4,APF-Nepal-Written-Exam-Schedule,8,APF-Promotion-List-From-Assistant-Head-Constable-to-Head-Constable,1,APF-Promotion-List-Recommendation,1,APFNepal,88,Asia,8,Australia,1,Australia-Oceania,3,Bagmati-Pradesh-Lok-Sewa-Aayog-Exam-Center,4,Bagmati-Pradesh-Lok-Sewa-Aayog-Exam-Result,5,Bagmati-Pradesh-Lok-Sewa-Aayog-Vacancy,5,Bakarid-Festival-Celebration-Wishes-Quotoes-and-Images,1,Balefi-Hydropower-Limited-IPO-Share,1,Ban-Rakshak-Exam-Result,1,Ban-Rakshak-Exam-Schedule,1,Ban-Rakshak-Model-Question,6,Ban-Rakshak-Old-Exam-Paper,1,Bank-of-Kathmandu-Limited,1,BanRakshak-Exam-Result,1,BanRakshak-Exam-Schedule,1,BBS-BSC-BED-BA-First-Year-Exam-Routine-2078,2,BBS-BSC-BED-Fourth-Year-Exam-Routine,1,BBS-BSC-BED-Second-YEar-Exam-Routine-2078,1,Belgium,2,Best-7-way-to-Earn-Money-Online,1,Best-Broker-In-Nepal,1,Best-Place-to-Visit-in-UAE,1,BOKL,1,Books,1,Brazil,1,British-Army-Vacancy,1,Broker-in-Nepal,1,Broker-Near-Me,1,BTS-Army-Biography,1,Buddha-Bhumi-Nepal-Hydropower-IPO-Share,1,Business-Tax-Exemptions-and-Facilities-in-Nepal,1,CAAN-Exam-Result,2,CAAN-Exam-Schedule,3,CAAN-Vacancy,3,Career,1496,CBS,14,CCVI-List-of-Committed-Workers,34,Celebrity-Biography,13,Celebrity-News,19,ComputerNotes,53,Countries-in-the-World,12,COVID19Nepal,5,CProgramming,6,Cricket,1,Cristiano-Ronaldo-Biography,1,CTEVT,10,Dairy-Development -Corporation-Exam-Result,1,Dish-Media-Network-Limited-IPO-Share,1,Domestic-Flights-in-Nepal-Resume-Operations,1,Dordi-Khola-Hydropower-Company-IPO-Share,1,DOTM-Nepal,9,DV-2022-Result,3,DV-2023-Opening-Date,3,DV-2023-Result,1,DV-2024,1,DV-2024-Opening-Date,1,DV-Lottery-America,5,DV-News,15,DV-Online-Form,5,DV-Result,5,DV-Result-2022,2,DV-Result-2023,2,EDV-2024,1,Election-in-Nepal,1,Elon-Musk-Biography,1,EnglishNotes,2,EPS,156,EPS-Flight-Schedule,56,EPS-Form-Fillup-Namelist,12,EPS-TOPIK-Test-Result,1,Esports-in-Asian-Games-2022,1,Europe,4,Everest-Hospital,1,Exam,1,ExamCenter,167,ExamPaper,41,ExamResult,417,ExamSchedule,270,Facebook,1,Facebookdown,2,Far-Western-University,1,Festival-Wishes,1,Football,3,Four-Wheeler-Driving-License-Test-New-Rules,1,Free-Skilled-Training-Program,3,Gandaki-Pradesh-Lok-Sewa-Aayog-Approved-namelist,1,Gandaki-Pradesh-Lok-Sewa-Aayog-Exam-Result,5,Gandaki-Pradesh-Lok-Sewa-Aayog-Exam-Schedule,3,Gandaki-Pradesh-Lok-Sewa-Aayog-Vacancy,3,Gandaki-Pradesh-Lok-Sewa-Exam-Result,1,GBIME,1,Geography,2,Ghana,1,Global-IME-Bank-Limited,1,Gorkhapatra,6,Government-Staff-Salary,18,Government-Teacher-Salary,1,GovernmentJobs,421,Green-Venture-Limited-Hydropower-IPO-Share,1,GuestPost,2,Gurkha Bharti,1,Happy-Bijaya-Dashami-Wishes-and-Photos,1,Happy-International-Nurse-Day,1,Himalayan-Hydropower-Limited-IPO-Share,1,Hong-Kong,1,How-to-apply-Online-Driving-License-Form,1,ICC-Mens-T20-World-Cup,1,Increase-in-Price-of-Petrol-Diesel-Kerosene-and-Aviation-Fuel-by-Nepal-Oil-Corporation,1,India,1,Indian-Army-Rank-and-Salary,1,Indian-Idol-Season-12-Winner,1,Indian-Navy-Rank-and-Salary,1,Instagramdown,2,IPL,5,IPOResult,41,IQ,6,Jeevan-Bikas-Laghubitta-Bittiya-Sanstha-Exam-Syllabus,1,Jeevan-Bikas-Laghubitta-Bittiya-Sanstha-Limited-IPO-Share,5,Jeff-Bezos-Biography,1,Justin-Bieber-Biography,1,Jyoti-Bikash-Bank,1,Karnali-Pradesh-Lok-Sewa-Aayog-Approved-Namelist,2,Karnali-Pradesh-Lok-Sewa-Aayog-Vacancy,2,Kathmandu-Upatyaka-Khanepani-Limited,1,Khabane-Lame-Biography,1,Krishi-Bikash-Bank-Limited,1,KSK,1,Kylian-Mbappe-Biography,1,Lionel-Messi-Biography,1,list-of-airlines-in-nepal,1,List-of-Ballon-dor-winners,1,List-of-Chief-of-Army-Staff-in-Nepal,1,List-of-Countries-and-their-Independence-Day,1,List-of-esport-gami-included-as-medal-events-in-asian-game,1,List-of-IGP-of-APF-Nepal,1,List-of-IGP-of-Nepal-Police,1,List-of-International-Days-in-the-World,1,List-of-Miss-Universe-Winner,2,List-of-Miss-World-Winner,1,List-of-Presidents-of-the-United-State-of-America,1,List-of-Prime-Minister-of-Belgium,1,List-of-Public-Holidays-in-Nepal,1,Live-Stream,1,Lok-Sewa-Aayog-Exam-Center,12,Lok-Sewa-Aayog-Exam-Result,9,Lok-Sewa-Aayog-Nayab-Subba-Exam-Result,1,Lok-Sewa-Aayog-Section-Officer-Exam-Result,2,Lok-Sewa-Aayog-Vacancy,4,LokSewa,220,LokSewa-Aayog-Contact-Number-and-Recruitment,2,Lumbini-Buddhist-University,1,Lumbini-Pradesh-Lok-Sewa-Aayog-Exam-Result,2,Madhya-Bhotekoshi-IPO-Result,1,Madhya-Bhotekoshi-Jalvidyut-Company-Limited-IPO-Share,2,Mahila-Laghubitta-Bittiya-Sanstha-Limited-Vacancy-for-Junior-Assistant-Trainee,1,Malung-Khola-Hydropower-Company-IPO-Share,1,Manakamana-Smart-Laghubitta-Bittiya-Sanstha-IPO-Share,1,Manushi-Laghubitta-Bittiya-Sanstha-IPO-Result,2,Manushi-Laghubitta-Bittiya-Sanstha-IPO-Share,1,MCQS,3,Messengerdown,1,Meta,1,Mid-Western-University,1,Milkha-Singh-Biography,1,Mobile,1,ModelQuestion,34,Most-Desirable-Men-On-Television,1,MSExcel,7,MSOfficePackage,19,MSPowerPoint,1,MSWord,11,Myadi-Police,10,Myadi-Prahari,10,NATHM,1,National-Cooperative-Bank-Model-Question,1,National-Skill-Resting-Board,1,NBL,3,NEA,25,NEA-Approved-Namelist,8,NEA-Exam-Notice,5,NEA-Exam-Result,8,NEA-Exam-Routine,2,NEA-Exam-Syllabus,1,NEA-Vacancy,1,NEB,5,NEB-Class-11-Exam-Result,1,NEB-Class-12-Exam-Result,2,NEB-Class-12-Exam-Routine,2,NEB-Exam-Routine,5,NEB-Postpone-Class-12-Examination,1,Nepa-Open-University-Exam-Routine,1,Nepal,2,Nepal-Administrative-Staff-College-Vacancy,1,Nepal-Army-Cadet-Vacancy,1,Nepal-Army-Exam-Routine,1,Nepal-Army-Sainya-Exam-Center,25,Nepal-Army-Sainya-Exam-Process,1,Nepal-Army-Sainya-Exam-Result,20,Nepal-Army-Sainya-Medical-Exam-Routine,1,Nepal-Army-Sainya-Physical-Exam-Routine,1,Nepal-Army-Sainya-Vacancy,1,Nepal-Army-Salary,1,Nepal-Army-Vacancy-2078,6,Nepal-Army-Vacancy-2079,2,Nepal-Army-Written-Exam-Center,1,Nepal-Army-Written-Exam-Result,4,Nepal-Army-Written-Exam-Routine,1,Nepal-Bank-Limited-Exam-Result,3,Nepal-Bank-Limited-Exam-Schedule,1,Nepal-Bank-Limited-Vacancy,1,Nepal-Driving-License-Test-Opens,1,Nepal-Electricity-Authority-Vacnacy,2,Nepal-Eye-Hospital,1,Nepal-Investment-Bank-Limited,1,Nepal-Life-Insurance-Company-Vacancy,1,Nepal-Oil-Corporation-Written-Exam-Center,3,Nepal-Oil-Corporation-Written-Exam-Schedule,3,Nepal-Police-ASI-Vacancy,1,Nepal-Police-Constable-Vacancy,1,Nepal-Police-Exam-Center,1,Nepal-Police-Exam-Result,19,Nepal-Police-Exam-Routine,1,Nepal-Police-Medical-Exam-Result,12,Nepal-Police-New-Vacany-2078-for-Technical-Group,1,Nepal-Police-Posting-List,7,Nepal-Police-Promotion-List,8,Nepal-Police-Promotion-Recommendent-List,54,Nepal-Police-Salary,2,Nepal-Police-Transfer-List,6,Nepal-Police-Vacnacy-2078,2,Nepal-Police-Written-Exam-Center,8,Nepal-Pragya-Prathisthan-Result,1,Nepal-Pragya=Prathisthan-Vacancy,1,Nepal-Reinsurance-Company-Limited,1,Nepal-Reinsurance-Company-Limited-Exam-Result,1,Nepal-Telecom,2,Nepal-Telecom-Exam-Center,1,NepalArmy,242,NepaliNotes,5,NepalPolice,274,NEPSE,149,NEPSE-Floor-Sheet-Updates,100,NEPSE-FloorSheet-Updates,72,New,3,New-Tax-Rate-in-Nepal-for-Fiscal-Year-2078-2079,1,News,2759,Neymar-Jr-Biography,1,NIBL,1,NID,29,Nijamati-Karmachari-Salary,1,NOC,8,North-America,3,Notes,38,NRB,16,NRB-Exam-Center,5,NRB-Vacancy,1,NTC,7,Nyadi-Hydropower-IPO-Result-Date,1,Nyadi-Hydropower-Limited-IPO-Share,1,Online-Earning,1,OnlineStore,4,Pradesh-No-1-Lok-Sewa-Aayog-Approved-Namelist,5,Pradesh-No-1-Lok-Sewa-Aayog-Exam-Schedule,2,Pradesh-No-1-Lok-Sewa-Aayog-Vacancy,1,PrivateBanking,173,PSC-Weekly-Notice,3,Public-Transport-New-Fare-in-Nepal,4,Puneeth-Rajkumar-Biography,1,Python,4,Questions,59,Quiz,1,Radio-Nepal,3,Radio-Nepal-Promotion-List,1,Radio-Nepal-Vacancy,1,Rastriya-Anusandhann-Bibhag-Exam-Center,1,Rastriya-Anusandhann-Bibhag-Exam-Result,20,Rastriya-Banijya-Bank-Limited,18,Rastriya-Samachar-Samiti,1,RBB,39,RBB--Exam-Paper,1,RBB-Exam-Result,14,Result,2,SAFF-Championship,1,Sahas-Urja-Limited-IPO-Share,2,Samling-Power-Company-IPO-Share,5,SEE-Exam-Routine,1,ShareNews,288,Singapore-Police-Vacancy,1,South-America,3,Sports,15,Sudurpashim-Pradesh-Lok-Sewa-Ban-Rakshak-Syllabus,1,Sudurpashim-Pradesh-Lok-Sewa-Exam-Schedule,1,Sudurpashim-Pradesh-Lok-Sewa-Vacancy,3,Swasthya-Sewa-Karmachari-Salary,1,Syllabus,10,Tally,9,Taylor-Swift-Biography,1,Teacher-Service-Commission,6,Teacher-Service-Commission-Annual-Vacancy-Schedule,1,Thiago-Silva-Biography,1,Time-Person-of-the-Year,1,TipsTricks,16,Top-10-Best-Casino-in-the-World,1,Top-10-Biggest-Casino-in-the-World,1,Top-10-Facts,30,Top-10-Highest-Paid-Actor,1,Top-10-Highest-Paid-Actress,1,Top-10-Highest-Paid-Athletes,1,Top-10-Highest-Paid-Celebrities-in-the-World,1,Top-10-Highest-Paid-Cost-Per-Click-Keywords,1,Top-10-Highest-Paid-Cricket-Player,1,Top-10-Highest-Paid-Football-Player,1,Top-10-Highest-Paid-NBA-Player,1,Top-10-Highest-Paid-Pornstar-Female,1,Top-10-Highest-Paid-Pornstar-Male,1,Top-10-Largest-Company-in-USA,1,Top-10-Most-Expensive-Keywords-in-Google-Ads,1,Top-10-Most-Luxurious-and-Expensive-Casino-in-the-World,1,Top-10-Most-Profitable-Casino-in-the-world,1,Top-10-Most-Searched-Animals-on-Google,1,Top-10-Most-Searched-Pets-and-Animals-on-Google,1,Top-10-Most-Searched-Pets-on-Google,1,Top-10-Most-Viewed-Website-in-the-World,1,Top-10-Oldest-Casino-in-the-world,1,Top-10-Payment-Gateways,1,Top-10-Payment-Gateways-in-World,1,Top-10-Richest-Actor-in-the-World,1,Top-10-Richest-Actress-in-the-World,1,Top-10-Richest-Cricket-Player-in-the-World,1,Top-10-Richest-Female-Adult-Star,1,Top-10-Richest-Female-Porn-Star,1,Top-10-Richest-Football-Player-in-the-World,1,Top-10-Richest-Person-in-the-World,1,Top-10-Richest-Women-in-the-World,1,Top-10-Smallest-Dog-Breads-in-World,1,Top-10=Most-Searched-Words-on-Google,1,Transportation,1,TSC,18,TU,38,TU-Exam-Result,2,TU-Exam-Routine,4,Two-Wheeler-Driving-License-Test-New-Rules,1,UAE-United-Arab-Emirates,2,UEFA-Euro-Cup,2,UFC,4,United-State-of-America,3,University,1,UpcomingIPO,60,Upper-Solu-Hydro-Electricity-Company-IPO-Share,1,V-Lottery-America,2,WebDesign,1,WhatsAppdown,2,World-Geography,9,World-Happiness-Index,1,Worst-Broker-in-Nepal,1,
ltr
item
Chetan TM: Snakify Python Program Solution Input Print and Numbers
Snakify Python Program Solution Input Print and Numbers
Python - Programming Language Snakify.org - Problem Solution. 1) Sum of three numbers. 2) Hi John. 3) Square. 4) Area of right-angled triangle.
https://1.bp.blogspot.com/-YjpgdB4NhsI/YGFIdNyvLUI/AAAAAAAAChE/iLQARmF-hKQGlKxtAl3CbVBS9-_cG9ECgCLcBGAsYHQ/s16000/Capture.PNG
https://1.bp.blogspot.com/-YjpgdB4NhsI/YGFIdNyvLUI/AAAAAAAAChE/iLQARmF-hKQGlKxtAl3CbVBS9-_cG9ECgCLcBGAsYHQ/s72-c/Capture.PNG
Chetan TM
http://www.chetantm.com.np/2021/03/snakify-input-print-and-number-python-program-solution.html
http://www.chetantm.com.np/
http://www.chetantm.com.np/
http://www.chetantm.com.np/2021/03/snakify-input-print-and-number-python-program-solution.html
true
5092578752892144998
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content