Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
suyashi29
GitHub Repository: suyashi29/python-su
Path: blob/master/Python Basics/Lab1-Practice questions on Python core.ipynb
3074 views
Kernel: Python 3

- Q1: User input a string "A" and "B" having with length 10 and 5 res

- Q2 : Convert String A to upper case

  • Concadenate two strings A and B

  • len , index, Slicing (extract last 3 members)

Q2: Create script to input two numbers x and y with following instruction:

  • add when user select 1, sub on 2, mul on 3, div 4 and power on 5(give options to select x^y or y^x)

x=int(input()) y=int(input())

Q3: create a x tuple of size 6 and type cast it into list and stored result in variable b

  • in b insert a member at 2nd position

Q4: Write a script to generate & print dictonary via user input, keys must be in numbers and values in strings¶

Q5: Write Script that accepts a sentence and calculate the number of letters and digits.

Q6: # Ask user to create a user name with len b/w 5-10, give 3 attempts,

end("Session Terminated")

Q7: Script to check validity a password on following points

  • length b/w 6-15

  • atleast one Uppercase, lowercase, digit and symbol(@,#,&,%,$)

  • no space allowed

Q8: Use a loop to display elements from a given list which are present at even positions